Struct odbc_safe::Environment[][src]

pub struct Environment<V: VersionOption> { /* 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:

  • The Environment's state
  • The current environment-level diagnostics
  • The handles of connections currently allocated on the environment
  • The current stetting of each environment attribute

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

Implementations

impl<V: VersionOption> 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>(
    mut self: 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: Debug + VersionOption> Debug for Environment<V>[src]

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

Auto Trait Implementations

impl<V> RefUnwindSafe for Environment<V> where
    V: RefUnwindSafe
[src]

impl<V> !Send for Environment<V>[src]

impl<V> !Sync for Environment<V>[src]

impl<V> Unpin for Environment<V> where
    V: Unpin
[src]

impl<V> UnwindSafe for Environment<V> where
    V: UnwindSafe
[src]

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.