Trait odbc_api::RowSetBuffer

source ·
pub unsafe trait RowSetBuffer {
    // Required methods
    fn bind_type(&self) -> usize;
    fn row_array_size(&self) -> usize;
    fn mut_num_fetch_rows(&mut self) -> &mut usize;
    unsafe fn bind_colmuns_to_cursor(
        &mut self,
        cursor: StatementRef<'_>
    ) -> Result<(), Error>;
    fn find_truncation(&self) -> Option<TruncationInfo>;
}
Expand description

A Row set buffer binds row, or column wise buffers to a cursor in order to fill them with row sets with each call to fetch.

§Safety

Implementers of this trait must ensure that every pointer bound in bind_to_cursor stays valid even if an instance is moved in memory. Bound members should therefore be likely references themselves. To bind stack allocated buffers it is recommended to implement this trait on the reference type instead.

Required Methods§

source

fn bind_type(&self) -> usize

Declares the bind type of the Row set buffer. 0 Means a columnar binding is used. Any non zero number is interpreted as the size of a single row in a row wise binding style.

source

fn row_array_size(&self) -> usize

The batch size for bulk cursors, if retrieving many rows at once.

source

fn mut_num_fetch_rows(&mut self) -> &mut usize

Mutable reference to the number of fetched rows.

§Safety

Implementations of this method must take care that the returned referenced stays valid, even if self should be moved.

source

unsafe fn bind_colmuns_to_cursor( &mut self, cursor: StatementRef<'_> ) -> Result<(), Error>

Binds the buffer either column or row wise to the cursor.

§Safety

It’s the implementation’s responsibility to ensure that all bound buffers are valid until unbound or the statement handle is deleted.

source

fn find_truncation(&self) -> Option<TruncationInfo>

Find an indicator larger than the maximum element size of the buffer.

Implementations on Foreign Types§

source§

impl<T: RowSetBuffer> RowSetBuffer for &mut T

Implementors§