pub struct Row { /* private fields */ }Expand description
One result row: ordered (column name, value) pairs.
Implementations§
Source§impl Row
impl Row
pub fn new(columns: Vec<(String, SeaValue)>) -> Self
Sourcepub fn column_names(&self) -> impl Iterator<Item = &str>
pub fn column_names(&self) -> impl Iterator<Item = &str>
Column names in result order.
Sourcepub fn columns(&self) -> impl Iterator<Item = (&str, &SeaValue)>
pub fn columns(&self) -> impl Iterator<Item = (&str, &SeaValue)>
Every column, in result order, untyped.
get answers “is this column an i64” and returns None
for a NULL, a missing column and an unrepresentable one alike — three
different facts wearing one answer. A caller that must serialise a row
it did not write, like a subject-access export, needs to tell them
apart: reporting a value it could not read as null is a quiet claim
that the database held nothing there.
Sourcepub fn get<T: TryFromValue>(&self, column: &str) -> Option<T>
pub fn get<T: TryFromValue>(&self, column: &str) -> Option<T>
Typed column access. None when the column is missing, NULL, or
not representable as T.
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