odbc_api/handles/
as_handle.rs

1use odbc_sys::{Handle, HandleType};
2
3/// Provides access to the raw underlying ODBC handle.
4///
5/// # Safety
6///
7/// The handle provided by `as_handle` must be valid and match the type returned by `handle_type`.
8pub unsafe trait AsHandle {
9    /// The raw underlying ODBC handle used to talk to the ODBC C API. The handle must be valid.
10    fn as_handle(&self) -> Handle;
11
12    /// The type of the ODBC handle returned by `as_handle`. This is a method rather than a constant
13    /// in order to make the type object safe.
14    fn handle_type(&self) -> HandleType;
15}