Struct redis_graph::GraphResult [−][src]
A graph query can return one or multiple values for every matching entry. A GraphResult contains a map of values for a single match. The map keys are the query RETURN statements, values can be of any GraphValue type in any order. The impl also contains some helper methods for easier extraction of graph values.
use redis_graph::GraphResult; let res = GraphResult::default(); let name:Option<String> = res.get_scalar("person2.name"); let person = res.get_node("person"); let friend_rel = res.get_relation("friend");
Fields
data: HashMap<String, GraphValue>
A map of raw return keys to GraphValues.
Implementations
impl GraphResult
[src]
Represents a group of returned graph values for a single matched result in the query. Contains some helper methods for easier extraction of graph values.
pub fn get_value(&self, key: &str) -> Option<&GraphValue>
[src]
Returns a single GraphValue by it's key.
pub fn get_scalar<T: FromRedisValue>(&self, key: &str) -> Option<T>
[src]
Tries to extract a graph Scalar value into target type T. Will return None in case the key does not exist, the target value is not a Scalar or the value could not be parsed into T.
pub fn get_node(&self, key: &str) -> Option<&NodeValue>
[src]
Tries to extract a graph Node value from Value at key. Will return
None in case the key does not exist or the target value is not a
Node.
pub fn get_relation(&self, key: &str) -> Option<&RelationValue>
[src]
Tries to extract a graph Relation value from Value at key. Will return
None in case the key does not exist or the target value is not a
Relation.
Trait Implementations
impl Clone for GraphResult
[src]
fn clone(&self) -> GraphResult
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for GraphResult
[src]
impl Default for GraphResult
[src]
fn default() -> GraphResult
[src]
Auto Trait Implementations
impl RefUnwindSafe for GraphResult
[src]
impl Send for GraphResult
[src]
impl Sync for GraphResult
[src]
impl Unpin for GraphResult
[src]
impl UnwindSafe for GraphResult
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,