pub struct QueryResponse {
pub data: Value,
pub rows_affected: Option<u64>,
pub execution_time_us: u64,
pub from_cache: bool,
pub metadata: Map<String, Value>,
}Expand description
Response from a query execution.
Fields§
§data: ValueThe raw response data (typically JSON).
rows_affected: Option<u64>Number of rows affected (for mutations).
execution_time_us: u64Execution time in microseconds.
from_cache: boolWhether the query was served from cache.
metadata: Map<String, Value>Additional metadata.
Implementations§
Source§impl QueryResponse
impl QueryResponse
Sourcepub fn with_affected(count: u64) -> Self
pub fn with_affected(count: u64) -> Self
Create a response with affected rows count.
Sourcepub fn with_execution_time(self, us: u64) -> Self
pub fn with_execution_time(self, us: u64) -> Self
Set execution time.
Sourcepub fn from_cache(self) -> Self
pub fn from_cache(self) -> Self
Mark as from cache.
Sourcepub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
pub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
Add metadata.
Trait Implementations§
Source§impl Clone for QueryResponse
impl Clone for QueryResponse
Source§fn clone(&self) -> QueryResponse
fn clone(&self) -> QueryResponse
Returns a duplicate of the value. Read more
1.0.0§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 QueryResponse
impl RefUnwindSafe for QueryResponse
impl Send for QueryResponse
impl Sync for QueryResponse
impl Unpin for QueryResponse
impl UnwindSafe for QueryResponse
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)