[−][src]Struct odbc_api::buffers::ColumnarRowSet
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]
max_rows: u32,
description: impl Iterator<Item = BufferDescription>
) -> Self
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]
max_rows: u32,
description: impl Iterator<Item = (u16, BufferDescription)>
) -> Self
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]
pub fn bind_type(&self) -> u32
[src]
pub fn row_array_size(&self) -> u32
[src]
pub fn mut_num_fetch_rows(&mut self) -> &mut usize
[src]
pub unsafe fn bind_to_cursor(
&mut self,
cursor: &mut impl Cursor
) -> Result<(), Error>
[src]
&mut self,
cursor: &mut impl Cursor
) -> Result<(), Error>
Auto Trait Implementations
impl RefUnwindSafe for ColumnarRowSet
[src]
impl Send for ColumnarRowSet
[src]
impl Sync for ColumnarRowSet
[src]
impl Unpin for ColumnarRowSet
[src]
impl UnwindSafe for ColumnarRowSet
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,