SQLHENV

Struct SQLHENV 

Source
pub struct SQLHENV<V: OdbcVersion = SQL_OV_ODBC3_80> { /* private fields */ }
Expand description

An environment is a global context which holds information such as:

  • The environment’s state
  • The current environment-level diagnostics
  • The handles of connections currently allocated on the environment
  • The current settings of each environment attribute

Environment handle is always used in calls to SQLDataSources and SQLDrivers and sometimes in calls to SQLAllocHandle, SQLEndTran, SQLFreeHandle, SQLGetDiagField, and SQLGetDiagRec.

§Documentation

https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/environment-handles

Implementations§

Source§

impl<V: OdbcVersion> SQLHENV<V>

Source

pub fn SQLDataSourcesA( &self, Direction: SQLUSMALLINT, ServerName: &mut OdbcStr<MaybeUninit<SQLCHAR>>, NameLength1Ptr: &mut impl AsMutPtr<SQLSMALLINT>, Description: &mut OdbcStr<MaybeUninit<SQLCHAR>>, NameLength2Ptr: &mut impl AsMutPtr<SQLSMALLINT>, ) -> SQLRETURN

Returns information about a data source. This function is implemented only by the Driver Manager.

For complete documentation on SQLDataSourcesA, see API reference.

§Returns

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA, SQL_ERROR, or SQL_INVALID_HANDLE.

Source

pub fn SQLDataSourcesW( &self, Direction: SQLUSMALLINT, ServerName: &mut OdbcStr<MaybeUninit<SQLWCHAR>>, NameLength1Ptr: &mut impl AsMutPtr<SQLSMALLINT>, Description: &mut OdbcStr<MaybeUninit<SQLWCHAR>>, NameLength2Ptr: &mut impl AsMutPtr<SQLSMALLINT>, ) -> SQLRETURN

Returns information about a data source. This function is implemented only by the Driver Manager.

For complete documentation on SQLDataSourcesW, see API reference.

§Returns

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA, SQL_ERROR, or SQL_INVALID_HANDLE.

Source

pub fn SQLDriversA( &self, Direction: SQLUSMALLINT, DriverDescription: &mut OdbcStr<MaybeUninit<SQLCHAR>>, DescriptionLengthPtr: &mut impl AsMutPtr<SQLSMALLINT>, DriverAttributes: &mut OdbcStr<MaybeUninit<SQLCHAR>>, AttributesLengthPtr: &mut impl AsMutPtr<SQLSMALLINT>, ) -> SQLRETURN

Lists driver descriptions and driver attribute keywords. This function is implemented only by the Driver Manager.

For complete documentation on SQLDriversA, see API reference.

§Returns

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA, SQL_ERROR, or SQL_INVALID_HANDLE.

Source

pub fn SQLDriversW( &self, Direction: SQLUSMALLINT, DriverDescription: &mut OdbcStr<MaybeUninit<SQLWCHAR>>, DescriptionLengthPtr: &mut impl AsMutPtr<SQLSMALLINT>, DriverAttributes: &mut OdbcStr<MaybeUninit<SQLWCHAR>>, AttributesLengthPtr: &mut impl AsMutPtr<SQLSMALLINT>, ) -> SQLRETURN

Lists driver descriptions and driver attribute keywords. This function is implemented only by the Driver Manager.

For complete documentation on SQLDriversW, see API reference.

§Returns

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA, SQL_ERROR, or SQL_INVALID_HANDLE.

Source

pub fn SQLGetEnvAttr<A: Ident<Type = SQLINTEGER>, T>( &self, Attribute: A, ValuePtr: Option<&mut T>, StringLengthPtr: Option<&mut MaybeUninit<T::StrLen>>, ) -> SQLRETURN
where T: AttrGet<A> + ?Sized + EnvAttr<A, V>, MaybeUninit<T::StrLen>: StrLen<SQLINTEGER>,

Returns the current setting of an environment attribute.

For complete documentation on SQLGetEnvAttr, see API reference.

§Returns

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA, SQL_ERROR, or SQL_INVALID_HANDLE.

Source

pub fn SQLSetEnvAttr<A: Ident<Type = SQLINTEGER>, T>( &mut self, Attribute: A, ValuePtr: T, ) -> SQLRETURN
where T: AttrSet<A> + EnvAttr<A, V>,

Sets attributes that govern aspects of environments.

For complete documentation on SQLSetEnvAttr, see API reference.

§Returns

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR, or SQL_INVALID_HANDLE.

Trait Implementations§

Source§

impl<V: OdbcVersion> Allocate<'_, SQL_NULL_HANDLE> for SQLHENV<V>

Source§

unsafe fn from_raw(handle: NonNull<RawHandle>) -> Self

Creates handle from a raw pointer Read more
Source§

fn SQLAllocHandle(InputHandle: &'src SRC) -> (Result<Self, ()>, SQLRETURN)

Allocates an environment, connection, statement, or descriptor handle. Read more
Source§

fn SQLFreeHandle(self)

Frees resources associated with a specific environment, connection, statement, or descriptor handle. Read more
Source§

impl<'env, V: OdbcVersion> Allocate<'env, SQLHENV<V>> for SQLHDBC<'env, C2, V>

Source§

unsafe fn from_raw(handle: NonNull<RawHandle>) -> Self

Creates handle from a raw pointer Read more
Source§

fn SQLAllocHandle(InputHandle: &'src SRC) -> (Result<Self, ()>, SQLRETURN)

Allocates an environment, connection, statement, or descriptor handle. Read more
Source§

fn SQLFreeHandle(self)

Frees resources associated with a specific environment, connection, statement, or descriptor handle. Read more
Source§

impl<V: OdbcVersion> AsSQLHANDLE for SQLHENV<V>

Source§

impl<V: Debug + OdbcVersion> Debug for SQLHENV<V>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<V: OdbcVersion> Diagnostics for SQLHENV<V>

Source§

fn SQLGetDiagFieldA<A: Ident<Type = SQLSMALLINT>, T>( &self, RecNumber: NonZeroI16, DiagIdentifier: A, DiagInfoPtr: Option<&mut T>, StringLengthPtr: Option<&mut MaybeUninit<T::StrLen>>, ) -> SQLRETURN
where T: AttrGet<A> + Ansi + ?Sized + DiagField<Self, A>, MaybeUninit<T::StrLen>: StrLen<SQLSMALLINT>,

Returns the current value of a field of a record of the diagnostic data structure (associated with a specified handle) that contains error, warning, and status information. Read more
Source§

fn SQLGetDiagFieldW<A: Ident<Type = SQLSMALLINT>, T>( &self, RecNumber: NonZeroI16, DiagIdentifier: A, DiagInfoPtr: Option<&mut T>, StringLengthPtr: Option<&mut MaybeUninit<T::StrLen>>, ) -> SQLRETURN
where T: AttrGet<A> + Unicode + ?Sized + DiagField<Self, A>, MaybeUninit<T::StrLen>: StrLen<SQLSMALLINT>,

Returns the current value of a field of a record of the diagnostic data structure (associated with a specified handle) that contains error, warning, and status information. Read more
Source§

fn SQLGetDiagRecA( &self, RecNumber: NonZeroI16, SQLState: &mut MaybeUninit<SQLSTATE<SQLCHAR>>, NativeErrorPtr: &mut impl AsMutPtr<SQLINTEGER>, MessageText: &mut OdbcStr<MaybeUninit<SQLCHAR>>, TextLengthPtr: &mut impl AsMutPtr<SQLSMALLINT>, ) -> SQLRETURN

Returns the current values of multiple fields of a diagnostic record that contains error, warning, and status information. Unlike SQLGetDiagField, which returns one diagnostic field per call, SQLGetDiagRec returns several commonly used fields of a diagnostic record, including the SQLSTATE, the native error code, and the diagnostic message text. Read more
Source§

fn SQLGetDiagRecW( &self, RecNumber: NonZeroI16, SQLState: &mut MaybeUninit<SQLSTATE<SQLWCHAR>>, NativeErrorPtr: &mut impl AsMutPtr<SQLINTEGER>, MessageText: &mut OdbcStr<MaybeUninit<SQLWCHAR>>, TextLengthPtr: &mut impl AsMutPtr<SQLSMALLINT>, ) -> SQLRETURN

Returns the current values of multiple fields of a diagnostic record that contains error, warning, and status information. Unlike SQLGetDiagField, which returns one diagnostic field per call, SQLGetDiagRec returns several commonly used fields of a diagnostic record, including the SQLSTATE, the native error code, and the diagnostic message text. Read more
Source§

impl<V: OdbcVersion> Drop for SQLHENV<V>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<V: OdbcVersion> Handle for SQLHENV<V>

Source§

impl<V: OdbcVersion> Send for SQLHENV<V>

Source§

impl<V: OdbcVersion> Sync for SQLHENV<V>

Auto Trait Implementations§

§

impl<V> Freeze for SQLHENV<V>

§

impl<V> RefUnwindSafe for SQLHENV<V>
where V: RefUnwindSafe,

§

impl<V> Unpin for SQLHENV<V>
where V: Unpin,

§

impl<V> UnwindSafe for SQLHENV<V>
where V: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.