pub struct QueryResult { /* private fields */ }Expand description
A query result: the boundary Edn value plus its ResultShape, with
typed accessors keyed to the shape.
Implementations§
Source§impl QueryResult
impl QueryResult
Sourcepub fn new(shape: ResultShape, value: Edn) -> Self
pub fn new(shape: ResultShape, value: Edn) -> Self
Wraps a boundary result value with its shape.
Sourcepub fn shape(&self) -> ResultShape
pub fn shape(&self) -> ResultShape
The result shape.
Sourcepub fn values_as<T: FromEdn>(&self) -> Result<Vec<T>, ClientError>
pub fn values_as<T: FromEdn>(&self) -> Result<Vec<T>, ClientError>
Typed values of a collection result.
§Errors
Returns ClientError::Decode if any value is not of type T.
Sourcepub fn scalar(&self) -> Option<&Edn>
pub fn scalar(&self) -> Option<&Edn>
The single value of a scalar result, or None when empty (nil).
Sourcepub fn scalar_as<T: FromEdn>(&self) -> Result<Option<T>, ClientError>
pub fn scalar_as<T: FromEdn>(&self) -> Result<Option<T>, ClientError>
The typed scalar value of a scalar result.
§Errors
Returns ClientError::Decode if the value is not of type T.
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 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request