Trait redis_graph::AsyncGraphCommands
source · pub trait AsyncGraphCommands: ConnectionLike + Send + Sized {
// Provided methods
fn graph_query<'a, K: ToRedisArgs + Send + Sync + 'a, Q: ToRedisArgs + Send + Sync + 'a>(
&'a mut self,
key: K,
query: Q
) -> RedisFuture<'_, GraphResultSet> { ... }
fn graph_ro_query<'a, K: ToRedisArgs + Send + Sync + 'a, Q: ToRedisArgs + Send + Sync + 'a>(
&'a mut self,
key: K,
query: Q
) -> RedisFuture<'_, GraphResultSet> { ... }
fn graph_profile<'a, K: ToRedisArgs + Send + Sync + 'a, Q: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
&'a mut self,
key: K,
query: Q
) -> RedisFuture<'_, RV> { ... }
fn graph_delete<'a, K: ToRedisArgs + Send + Sync + 'a>(
&'a mut self,
key: K
) -> RedisFuture<'_, String> { ... }
fn graph_explain<'a, K: ToRedisArgs + Send + Sync + 'a, Q: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
&'a mut self,
key: K,
query: Q
) -> RedisFuture<'_, RV> { ... }
fn graph_slowlog<'a, K: ToRedisArgs + Send + Sync + 'a>(
&'a mut self,
key: K
) -> RedisFuture<'_, Vec<SlowLogEntry>> { ... }
fn graph_config_set<'a, K: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a>(
&'a mut self,
name: K,
value: V
) -> RedisFuture<'_, bool> { ... }
fn graph_config_get<'a, K: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
&'a mut self,
name: K
) -> RedisFuture<'_, RV> { ... }
fn graph_config_get_all<'a>(&'a mut self) -> RedisFuture<'_, GraphConfig> { ... }
}
Expand description
Provides a high level asynchronous API to work with Redis graph data types. The graph command becomes directly available on ConnectionLike types from the redis crate when you import the GraphCommands trait.
use redis::AsyncCommands;
use redis_graph::{AsyncGraphCommands, GraphResultSet};
let client = redis::Client::open("redis://127.0.0.1/")?;
let mut con = client.get_async_connection().await?;
let res:GraphResultSet = con.graph_query(
"my_graph",
"CREATE (:Rider {name:'Valentino Rossi'})-[:rides]->(:Team {name:'Yamaha'})"
).await?;
let res_read_only:GraphResultSet = con.graph_ro_query(
"my_graph",
"MATCH (rider:Rider)-[:rides]->(:Team {name:'Yamaha'}) RETURN rider"
).await?;