odbc_api::handles

Trait CData

Source
pub unsafe trait CData {
    // Required methods
    fn cdata_type(&self) -> CDataType;
    fn indicator_ptr(&self) -> *const isize;
    fn value_ptr(&self) -> *const c_void;
    fn buffer_length(&self) -> isize;
}
Expand description

Provides description of C type layout and pointers to it. Used to bind and buffers to ODBC statements.

§Safety

In case of variable sized types Self::indicator_ptr must not exceed the value pointed to by Self::value_ptr. This requirement is a bit tricky since, if the same indicator buffer is used in an output paramater the indicator value may be larger in case of truncation.

Required Methods§

Source

fn cdata_type(&self) -> CDataType

The identifier of the C data type of the value buffer. When it is retrieving data from the data source with fetch, the driver converts the data to this type. When it sends data to the source, the driver converts the data from this type.

Source

fn indicator_ptr(&self) -> *const isize

Indicates the length of variable sized types. May be zero for fixed sized types. Used to determine the size or existence of input parameters.

Source

fn value_ptr(&self) -> *const c_void

Pointer to a value corresponding to the one described by cdata_type.

Source

fn buffer_length(&self) -> isize

Maximum length of the type in bytes (not characters). It is required to index values in bound buffers, if more than one parameter is bound. Can be set to zero for types not bound as parameter arrays, i.e. CStr.

Implementations on Foreign Types§

Source§

impl CData for f32

Source§

impl CData for f64

Source§

impl CData for i8

Source§

impl CData for i16

Source§

impl CData for i32

Source§

impl CData for i64

Source§

impl CData for u8

Source§

impl CData for u16

Source§

impl CData for u32

Source§

impl CData for u64

Source§

impl CData for Box<dyn InputParameter>

Source§

impl CData for CString

Source§

impl CData for CStr

Source§

impl CData for Date

Source§

impl CData for Numeric

Source§

impl CData for Time

Source§

impl CData for Timestamp

Source§

impl<T> CData for Vec<T>
where T: Pod,

Implementors§

Source§

impl CData for AnyBuffer

Source§

impl CData for BinColumn

Source§

impl CData for Bit

Source§

impl CData for CharColumn

Source§

impl CData for WCharColumn

Source§

impl<B, K> CData for VarCell<B, K>
where B: Borrow<[K::Element]>, K: VarKind,

Source§

impl<T> CData for WithDataType<T>
where T: CData,

Source§

impl<T> CData for Nullable<T>
where T: Pod,