[][src]Struct odbc_api::buffers::ColumnarRowSet

pub struct ColumnarRowSet { /* fields omitted */ }

A columnar buffer intended to be bound with crate::Cursor::bind_buffer in order to obtain results from a cursor.

This buffer is designed to be versatile. It supports a wide variety of usage scenarios. It is efficient in retrieving data, but expensive to allocate, as columns are allocated separately. This is required in order to efficiently allow for rebinding columns, if this buffer is used to provide array input parameters those maximum size is not known in advance.

Most applications should find the overhead negligible, especially if instances are reused.

Implementations

impl ColumnarRowSet[src]

pub fn new(
    max_rows: u32,
    description: impl Iterator<Item = BufferDescription>
) -> Self
[src]

Allocates for each buffer description a buffer large enough to hold max_rows.

pub fn with_column_indices(
    max_rows: u32,
    description: impl Iterator<Item = (u16, BufferDescription)>
) -> Self
[src]

Allows you to pass the buffer descriptions together with a one based column index referring the column, the buffer is supposed to bind to. This allows you also to ignore columns in a result set, by not binding them at all. There is no restriction on the order of column indices passed, but the function will panic, if the indices are not unique.

pub fn column(&self, buffer_index: usize) -> AnyColumnView<'_>[src]

Use this method to gain access to the actual column data.

Parameters

  • buffer_index: Please note that the buffer index is not identical to the ODBC column index. For once it is zero based. It also indexes the buffer bound, and not the columns of the output result set. This is important, because not every column needs to be bound. Some columns may simply be ignored. That being said, if every column of the output should is bound in the buffer, in the same order in which they are enumerated in the result set, the relationship between column index and buffer index is `buffer_index = column_index - 1'.

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

Number of valid rows in the buffer.

Trait Implementations

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