pub struct Row { /* private fields */ }Implementations§
Source§impl Row
impl Row
pub fn new(columns: Columns, values: Vec<Value>) -> Self
pub fn columns(&self) -> &[String]
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn get<T: FromValue>(&self, column: &str) -> Result<T>
pub fn get<T: FromValue>(&self, column: &str) -> Result<T>
Read a column by name, converted to T.
The error names the column, because “invalid type” with no column name is the least useful message a database layer can produce.
Sourcepub fn get_or<T: FromValue>(&self, column: &str, default: T) -> T
pub fn get_or<T: FromValue>(&self, column: &str, default: T) -> T
Read a column, falling back when it is absent or NULL.
pub fn value(&self, column: &str) -> Result<&Value>
Sourcepub fn value_at(&self, index: usize) -> Result<&Value>
pub fn value_at(&self, index: usize) -> Result<&Value>
The value at a position, for a result whose columns the database did not name.
pub fn has(&self, column: &str) -> bool
Trait Implementations§
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