pub struct Row { /* private fields */ }Expand description
One row read with SELECT *, columns in table order.
Implementations§
Source§impl Row
impl Row
Sourcepub fn new(columns: Vec<String>, values: Vec<Value>) -> Self
pub fn new(columns: Vec<String>, values: Vec<Value>) -> Self
A row with these columns and values (same length and order).
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &Value)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &Value)>
(column, value) pairs in table order.
Sourcepub fn get(&self, column: &str) -> Option<&Value>
pub fn get(&self, column: &str) -> Option<&Value>
The value of a column; None when the table has no such column.
Sourcepub fn has(&self, column: &str) -> bool
pub fn has(&self, column: &str) -> bool
The column exists in this row’s table (it may still be NULL).
Sourcepub fn opt_int(&self, column: &str) -> Option<i64>
pub fn opt_int(&self, column: &str) -> Option<i64>
Integer value (reals are truncated); None when NULL, missing or not a number.
Sourcepub fn opt_real(&self, column: &str) -> Option<f64>
pub fn opt_real(&self, column: &str) -> Option<f64>
Real value (integers converted); None when NULL, missing or not a number.
Sourcepub fn text(&self, column: &str) -> Option<String>
pub fn text(&self, column: &str) -> Option<String>
Text value; UTF-8 blobs are decoded too. None when NULL or missing.
Trait Implementations§
impl StructuralPartialEq for Row
Auto Trait Implementations§
impl Freeze for Row
impl RefUnwindSafe for Row
impl Send for Row
impl Sync for Row
impl Unpin for Row
impl UnsafeUnpin for Row
impl UnwindSafe for Row
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