Allocate

Trait Allocate 

Source
pub trait Allocate<'src, SRC: AsSQLHANDLE>: Handle {
    // Required method
    unsafe fn from_raw(output_handle: NonNull<RawHandle>) -> Self;

    // Provided methods
    fn SQLAllocHandle(InputHandle: &'src SRC) -> (Result<Self, ()>, SQLRETURN) { ... }
    fn SQLFreeHandle(self) { ... }
}

Required Methods§

Source

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

Creates handle from a raw pointer

§Safety

The given raw pointer must point to a valid handle of the required type

Provided Methods§

Source

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

Allocates an environment, connection, statement, or descriptor handle.

For complete documentation on SQLAllocHandle, see API reference.

§Returns

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_INVALID_HANDLE, or SQL_ERROR.

Source

fn SQLFreeHandle(self)

Frees resources associated with a specific environment, connection, statement, or descriptor handle.

For complete documentation on SQLFreeHandle, see API reference.

§Panics

Panics if the DM returns value other than SQL_SUCCESS

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'env, 'conn, 'buf, V: OdbcVersion> Allocate<'conn, SQLHDBC<'env, C4, V>> for SQLHDESC<'conn, AppDesc<'buf>, V>

Source§

impl<'env, 'conn, 'buf, V: OdbcVersion> Allocate<'conn, SQLHDBC<'env, C4, V>> for UnsafeSQLHDESC<'conn, AppDesc<'buf>, V>

Source§

impl<'env, 'conn, V: OdbcVersion> Allocate<'conn, SQLHDBC<'env, C4, V>> for SQLHSTMT<'conn, '_, '_, V>

Source§

impl<'env, 'conn, V: OdbcVersion> Allocate<'conn, SQLHDBC<'env, C4, V>> for UnsafeSQLHSTMT<'conn, '_, '_, V>

Source§

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

Source§

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