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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more