[−][src]Struct odbc_safe::Environment
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
Methods
impl<V> Environment<V>
[src]
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]
&mut self,
direction: FetchOrientation,
server_name: &mut [u8],
description: &mut [u8]
) -> ReturnOption<(SQLSMALLINT, SQLSMALLINT)>
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]
&mut self,
direction: FetchOrientation,
description: &mut [u8],
attributes: &mut [u8]
) -> ReturnOption<(SQLSMALLINT, SQLSMALLINT)>
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]
self
) -> Return<Environment<V>, Environment<NoVersion>>
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]
self
) -> Return<Environment<Odbc3m8>, Environment<NoVersion>>
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]
self
) -> Return<Environment<Odbc3>, Environment<NoVersion>>
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]
fn diagnostics(
&self,
rec_number: SQLSMALLINT,
message_text: &mut [SQLCHAR]
) -> ReturnOption<DiagResult>
[src]
&self,
rec_number: SQLSMALLINT,
message_text: &mut [SQLCHAR]
) -> ReturnOption<DiagResult>
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,
V: Unpin,
impl<V> UnwindSafe for Environment<V> where
V: UnwindSafe,
V: UnwindSafe,
impl<V> RefUnwindSafe for Environment<V> where
V: RefUnwindSafe,
V: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,