[][src]Struct odbc_api::buffers::TextRowSet

pub struct TextRowSet { /* fields omitted */ }

This row set binds a string buffer to each column, which is large enough to hold the maximum length string representation for each element in the row set at once.

Implementations

impl TextRowSet[src]

pub fn for_cursor(
    batch_size: u32,
    cursor: &impl Cursor
) -> Result<TextRowSet, Error>
[src]

Use cursor to query the display size for each column of the row set and allocates the buffers accordingly.

pub fn new(
    batch_size: u32,
    max_str_lengths: impl Iterator<Item = usize>
) -> Self
[src]

Creates a text buffer large enough to hold batch_size rows with one column for each item max_str_lengths of respective size.

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

Access the element at the specified position in the row set.

pub fn at_as_str(
    &self,
    col_index: usize,
    row_index: usize
) -> Result<Option<&str>, Utf8Error>
[src]

Access the element at the specified position in the row set.

pub fn num_cols(&self) -> usize[src]

Return the number of columns in the row set.

pub fn num_rows(&self) -> usize[src]

Return the number of rows in the row set.

pub fn append<'a>(&mut self, row: impl Iterator<Item = Option<&'a [u8]>>)[src]

Takes one element from the iterater for each internal column buffer and appends it to the end of the buffer. Should the buffer be not large enough to hold the element, it will be reallocated with 1.2 times its size.

This method panics if it is tried to insert elements beyond batch size. It will also panic if row does not contain at least one item for each internal column buffer.

pub fn clear(&mut self)[src]

Sets the number of rows in the buffer to zero.

Trait Implementations

impl<'_> ParameterCollection for &'_ TextRowSet[src]

impl RowSetBuffer for TextRowSet[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.