odbc_api::buffers

Type Alias WCharColumn

Source
pub type WCharColumn = TextColumn<u16>;
Expand description

This buffer uses wide characters which implies UTF-16 encoding. UTF-8 encoding is preferable for most applications, but contrary to its sibling crate::buffers::CharColumn this buffer types implied encoding does not depend on the system locale.

Aliased Type§

struct WCharColumn { /* private fields */ }

Implementations§

Source§

impl WCharColumn

Source

pub unsafe fn ustr_at(&self, row_index: usize) -> Option<&U16Str>

The string slice at the specified position as U16Str. Includes interior nuls, but excludes the terminating nul.

§Safety

The column buffer does not know how many elements were in the last row group, and therefore can not guarantee the accessed element to be valid and in a defined state. It also can not panic on accessing an undefined element. It will panic however if row_index is larger or equal to the maximum number of elements in the buffer.

Trait Implementations§

Source§

impl CData for WCharColumn

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.
Source§

impl CDataMut for WCharColumn

Source§

fn mut_indicator_ptr(&mut self) -> *mut isize

Indicates the length of variable sized types. May be zero for fixed sized types.
Source§

fn mut_value_ptr(&mut self) -> *mut c_void

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

impl HasDataType for WCharColumn

Source§

fn data_type(&self) -> DataType

The SQL data as which the parameter is bound to ODBC.