[][src]Struct odbc_api::buffers::TextColumn

pub struct TextColumn { /* fields omitted */ }

A buffer intended to be bound to a column of a cursor. Elements of the buffer will contain a variable amount of characters up to a maximum string length. Since most SQL types have a string representation this buffer can be bound to a column of almost any type, ODBC driver and driver manager should take care of the conversion. Since elements of this type have variable length an indicator buffer needs to be bound, wether the column is nullable or not, and therefore does not matter for this buffer.

Implementations

impl TextColumn[src]

pub fn new(batch_size: usize, max_str_len: usize) -> Self[src]

This will allocate a value and indicator buffer for batch_size elments. Each value may have a maximum length of max_str_len. This implies that max_str_len is increased by one in order to make space for the null terminating zero at the end of strings.

pub unsafe fn value_at(&self, row_index: usize) -> Option<&[u8]>[src]

Return the value for the given row index.

#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

impl ColumnBuffer for TextColumn[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.