pub struct CellGetter<'a> { /* private fields */ }
Expand description
Cell Getter - Utility to make it easier to retrieve a Cell
from a
Row
object.
Implementations§
Source§impl<'a> CellGetter<'a>
impl<'a> CellGetter<'a>
Sourcepub fn new(columns: &'a ColumnMapper<'a>) -> Self
pub fn new(columns: &'a ColumnMapper<'a>) -> Self
Create a new CellGetter
from a reference to a ColumnMapper
object
Sourcepub fn from_mapper(columns: &'a ColumnMapper<'a>) -> Self
pub fn from_mapper(columns: &'a ColumnMapper<'a>) -> Self
Create a new CellGetter
from a reference to a ColumnMapper
object
Sourcepub fn by_name<'b>(
&'a self,
row: &'a Row,
name: &'b str,
) -> Result<&Cell, Box<dyn Error + Send + Sync>>
pub fn by_name<'b>( &'a self, row: &'a Row, name: &'b str, ) -> Result<&Cell, Box<dyn Error + Send + Sync>>
Create a new CellGetter
from a reference to a mapping of column name
to column id
NOTE: Disabling this for now, because I can’t get the lifetimes to work.
Find a cell
in a row
by its column name.
Sourcepub fn by_id(
&'a self,
row: &'a Row,
column_id: u64,
) -> Result<&Cell, Box<dyn Error + Send + Sync>>
pub fn by_id( &'a self, row: &'a Row, column_id: u64, ) -> Result<&Cell, Box<dyn Error + Send + Sync>>
Find a cell
in a row
by its column id.
Sourcepub fn name_to_cell(&'a self, row: &'a Row) -> ColumnNameToCell<'a>
pub fn name_to_cell(&'a self, row: &'a Row) -> ColumnNameToCell<'a>
Retrieve a mapping of column name to Cell
object.
Note: this is likely more efficient when multiple Cell
s are to be
retrieved from an individual Row
.
Auto Trait Implementations§
impl<'a> Freeze for CellGetter<'a>
impl<'a> RefUnwindSafe for CellGetter<'a>
impl<'a> Send for CellGetter<'a>
impl<'a> Sync for CellGetter<'a>
impl<'a> Unpin for CellGetter<'a>
impl<'a> UnwindSafe for CellGetter<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more