pub struct QueryResult {
pub chunks: Vec<DataChunk>,
pub num_rows: usize,
pub num_columns: usize,
pub success: bool,
pub error_message: Option<String>,
pub message: Option<String>,
pub summary: Option<QuerySummary>,
}Expand description
The result of executing a Cypher query.
Contains result chunks as column-major DataChunk vectors, metadata
(row/column counts), and optional timing summary.
§Examples
let result = conn.query("MATCH (n) RETURN n LIMIT 5")?;
println!("Rows: {}, Columns: {}", result.num_rows, result.num_columns);
for chunk in &result.chunks {
for field_idx in 0..chunk.fields.len() {
for row in 0..chunk.size {
if let Some(val) = chunk.get_value(field_idx, row) {
println!(" {:?}", val);
}
}
}
}Fields§
§chunks: Vec<DataChunk>§num_rows: usize§num_columns: usize§success: bool§error_message: Option<String>§message: Option<String>Human-readable message (e.g. “Table created” for DDL).
summary: Option<QuerySummary>Timing summary for the query.
Implementations§
Source§impl QueryResult
impl QueryResult
pub fn new(chunks: Vec<DataChunk>) -> Self
Sourcepub fn success_message(msg: String) -> Self
pub fn success_message(msg: String) -> Self
Create a success result with a human-readable message (no data chunks).
Sourcepub fn with_summary(self, summary: QuerySummary) -> Self
pub fn with_summary(self, summary: QuerySummary) -> Self
Attach timing summary to this result.
pub fn error(msg: String) -> Self
pub fn is_success(&self) -> bool
pub fn num_rows(&self) -> usize
pub fn num_columns(&self) -> usize
Sourcepub fn result_summary(&self) -> String
pub fn result_summary(&self) -> String
Get a human-readable summary of the result.
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QueryResult
impl Debug for QueryResult
Auto Trait Implementations§
impl !RefUnwindSafe for QueryResult
impl !UnwindSafe for QueryResult
impl Freeze for QueryResult
impl Send for QueryResult
impl Sync for QueryResult
impl Unpin for QueryResult
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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