pub struct QueryResult {
pub columns: Vec<String>,
pub rows: Vec<Vec<Value>>,
}Expand description
Final materialized query result.
Fields§
§columns: Vec<String>Named column headers, in the same order as values within each row.
For RETURN queries these are the projected aliases (or expression
text when no alias is given). For CALL procedures these are the
output column names declared by the procedure (e.g. ["type", "name", "properties"] for CALL db.schema()).
rows: Vec<Vec<Value>>Implementations§
Source§impl QueryResult
impl QueryResult
pub fn empty(columns: Vec<String>) -> Self
Sourcepub fn row_as_map(&self, idx: usize) -> Option<HashMap<String, Value>>
pub fn row_as_map(&self, idx: usize) -> Option<HashMap<String, Value>>
Return row idx as a HashMap<column_name, Value>.
Returns None if idx is out of bounds. Column names come from
self.columns; if the columns list is shorter than the row, extra
values are dropped. If the columns list is longer than the row,
missing values are absent from the map (they are never Null-padded).
Trait Implementations§
Source§impl Clone for QueryResult
impl Clone for QueryResult
Source§fn clone(&self) -> QueryResult
fn clone(&self) -> QueryResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for QueryResult
impl RefUnwindSafe for QueryResult
impl Send for QueryResult
impl Sync for QueryResult
impl Unpin for QueryResult
impl UnsafeUnpin for QueryResult
impl UnwindSafe for QueryResult
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