Trait BlockExt

Source
pub trait BlockExt: Debug + Sized {
    // Required methods
    fn num_of_rows(&self) -> usize;
    fn fields(&self) -> &[Field];
    fn precision(&self) -> Precision;
    fn is_null(&self, row: usize, col: usize) -> bool;
    unsafe fn cell_unchecked(
        &self,
        row: usize,
        col: usize,
    ) -> (&Field, BorrowedValue<'_>);
    unsafe fn get_col_unchecked(&self, col: usize) -> &ColumnView;

    // Provided methods
    fn field_count(&self) -> usize { ... }
    unsafe fn get_field_unchecked(&self, col: usize) -> &Field { ... }
    fn get_field(&self, col: usize) -> Option<&Field> { ... }
    fn columns_iter(&self) -> ColsIter<'_, Self>  { ... }
}
Expand description

Trait to define a data Block to fetch records bulky.

If query performance is not your main concern, you can just use the deserialize method from result set.

Required Methods§

Source

fn num_of_rows(&self) -> usize

A block should container number of rows.

Source

fn fields(&self) -> &[Field]

Fields can be queried from a block.

Source

fn precision(&self) -> Precision

Source

fn is_null(&self, row: usize, col: usize) -> bool

Source

unsafe fn cell_unchecked( &self, row: usize, col: usize, ) -> (&Field, BorrowedValue<'_>)

§Safety

DO NOT call it directly.

Source

unsafe fn get_col_unchecked(&self, col: usize) -> &ColumnView

§Safety

DO NOT call it directly.

Provided Methods§

Source

fn field_count(&self) -> usize

Number of fields.

Source

unsafe fn get_field_unchecked(&self, col: usize) -> &Field

Get field without column index check.

§Safety

This should not be called manually, please use get_field.

Source

fn get_field(&self, col: usize) -> Option<&Field>

Get field of one column.

Source

fn columns_iter(&self) -> ColsIter<'_, Self>

Query by rows. Consume self into rows. Columns iterator with borrowed data from block.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§