pub trait GraphStore: Send + Sync {
// Required methods
fn upsert_node<'life0, 'async_trait>(
&'life0 self,
node: Node,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn add_edge<'life0, 'async_trait>(
&'life0 self,
edge: Edge,
) -> Pin<Box<dyn Future<Output = Result<EdgeId>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_node<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NodeId,
) -> Pin<Box<dyn Future<Output = Result<Option<Node>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_edge<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 EdgeId,
) -> Pin<Box<dyn Future<Output = Result<Option<Edge>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn nodes_by_label<'life0, 'life1, 'async_trait>(
&'life0 self,
label: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Node>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn edges_from<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 NodeId,
label: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Edge>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn edges_to<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
to: &'life1 NodeId,
label: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Edge>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(usize, usize)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Storage abstraction. Concrete implementations: InMemoryGraph.
Required Methods§
Sourcefn upsert_node<'life0, 'async_trait>(
&'life0 self,
node: Node,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upsert_node<'life0, 'async_trait>(
&'life0 self,
node: Node,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert / replace a node by id.
Sourcefn add_edge<'life0, 'async_trait>(
&'life0 self,
edge: Edge,
) -> Pin<Box<dyn Future<Output = Result<EdgeId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_edge<'life0, 'async_trait>(
&'life0 self,
edge: Edge,
) -> Pin<Box<dyn Future<Output = Result<EdgeId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert an edge.
Sourcefn get_node<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NodeId,
) -> Pin<Box<dyn Future<Output = Result<Option<Node>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_node<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NodeId,
) -> Pin<Box<dyn Future<Output = Result<Option<Node>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Look up a node by id.
Sourcefn get_edge<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 EdgeId,
) -> Pin<Box<dyn Future<Output = Result<Option<Edge>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_edge<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 EdgeId,
) -> Pin<Box<dyn Future<Output = Result<Option<Edge>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Look up an edge by id.
Sourcefn nodes_by_label<'life0, 'life1, 'async_trait>(
&'life0 self,
label: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Node>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn nodes_by_label<'life0, 'life1, 'async_trait>(
&'life0 self,
label: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Node>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
All nodes carrying any of labels.
Sourcefn edges_from<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 NodeId,
label: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Edge>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn edges_from<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 NodeId,
label: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Edge>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
All edges leaving from (optionally filtered by label).
Sourcefn edges_to<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
to: &'life1 NodeId,
label: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Edge>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn edges_to<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
to: &'life1 NodeId,
label: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Edge>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
All edges entering to (optionally filtered by label).