Struct redis_graph::GraphResult[][src]

pub struct GraphResult {
    pub data: HashMap<String, GraphValue>,
}

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]

impl Debug for GraphResult[src]

impl Default for GraphResult[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.