[][src]Struct odbc_safe::Environment

pub struct Environment<V> { /* fields omitted */ }

An Environment is a global context, in which to access data.

Associated with an Environment is any information that is global in nature, such as:

See: [Environment Handles in the ODBC Reference][1] [1]: https://docs.microsoft.com/sql/odbc/reference/develop-app/environment-handles

Methods

impl<V> Environment<V>[src]

pub fn as_raw(&self) -> SQLHENV[src]

Provides access to the raw ODBC environment handle.

impl<V: Version> Environment<V>[src]

pub fn data_sources(
    &mut self,
    direction: FetchOrientation,
    server_name: &mut [u8],
    description: &mut [u8]
) -> ReturnOption<(SQLSMALLINT, SQLSMALLINT)>
[src]

Fills buffers with information about the available datasources

A 32 / 64 Bit Application will only return information about either 32 or 64 Bit DataSources.

Returns

(server_name_length, description_length)

See [SQLDataSources][1] [1]: https://docs.microsoft.com/sql/odbc/reference/syntax/sqldatasources-function

pub fn drivers(
    &mut self,
    direction: FetchOrientation,
    description: &mut [u8],
    attributes: &mut [u8]
) -> ReturnOption<(SQLSMALLINT, SQLSMALLINT)>
[src]

Fills buffers with information about the available datasources

A 32 / 64 Bit Application will only return information about either 32 or 64 Bit DataSources.

Returns

(description_length, attributes_length)

See [SQLDrivers][1] [1]: https://docs.microsoft.com/sql/odbc/reference/syntax/sqldrivers-function

impl Environment<NoVersion>[src]

pub fn new() -> Return<Self>[src]

Allocates a new Environment

pub fn declare_version<V: Version>(
    self
) -> Return<Environment<V>, Environment<NoVersion>>
[src]

Before an application allocates a connection which specification it follows. Currently these bindings only support ODBC 3.x.

It is valid to specify ODBC 3.x even then connecting to an ODBC 2.x driver. Applications must however avoid calling 3.x functionality on 2.x drivers. Since drivers are connected at runtime, these kind of errors can not be catched by the type system.

pub fn declare_version_3_8(
    self
) -> Return<Environment<Odbc3m8>, Environment<NoVersion>>
[src]

Before an application allocates a connection which specification it follows. Currently these bindings only support ODBC 3.x.

It is valid to specify ODBC 3.x even then connecting to an ODBC 2.x driver. Applications must however avoid calling 3.x functionality on 2.x drivers. Since drivers are connected at runtime, these kind of errors can not be catched by the type system.

This method is a shorthand for declare_version::<Odbc3m8>.

pub fn declare_version_3(
    self
) -> Return<Environment<Odbc3>, Environment<NoVersion>>
[src]

Before an application allocates a connection which specification it follows. Currently these bindings only support ODBC 3.x.

It is valid to specify ODBC 3.x even then connecting to an ODBC 2.x driver. Applications must however avoid calling 3.x functionality on 2.x drivers. Since drivers are connected at runtime, these kind of errors can not be catched by the type system.

This method is a shorthand for declare_version::<Odbc3>.

Trait Implementations

impl<V> Diagnostics for Environment<V>[src]

impl<V: Debug> Debug for Environment<V>[src]

Auto Trait Implementations

impl<V> !Send for Environment<V>

impl<V> !Sync for Environment<V>

impl<V> Unpin for Environment<V> where
    V: Unpin

impl<V> UnwindSafe for Environment<V> where
    V: UnwindSafe

impl<V> RefUnwindSafe for Environment<V> where
    V: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]