pub struct Row { /* private fields */ }Expand description
One result row: raw stringified cells plus the shared column schema.
Implementations§
Source§impl Row
impl Row
Sourcepub fn new(
values: Vec<Option<String>>,
columns: Arc<Vec<Column>>,
index: Arc<HashMap<String, usize>>,
) -> Self
pub fn new( values: Vec<Option<String>>, columns: Arc<Vec<Column>>, index: Arc<HashMap<String, usize>>, ) -> Self
Builds a row from its raw cells and the shared schema/index.
Sourcepub fn raw(&self, name: &str) -> Option<&str>
pub fn raw(&self, name: &str) -> Option<&str>
The raw cell value for a column name (case-insensitive), if present.
Sourcepub fn to_json_object(&self) -> Map<String, Value>
pub fn to_json_object(&self) -> Map<String, Value>
Converts the row to a JSON object keyed by column name.
Repeated column names (e.g. SELECT 1, 1) are disambiguated with a
_<n> suffix so no column is silently dropped — JSON object keys must be
unique.
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