Struct redis_graph::GraphResult[][src]

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

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

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.

Returns a single GraphValue by it’s key.

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.

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.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.