pub trait GraphStorage: Send + Sync {
Show 13 methods
// Required methods
fn store_graph<'life0, 'life1, 'async_trait>(
&'life0 self,
graph: &'life1 KnowledgeGraph,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn load_graph<'life0, 'life1, 'async_trait>(
&'life0 self,
graph_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<KnowledgeGraph>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn store_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
nodes: &'life1 [GraphNode],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn store_edges<'life0, 'life1, 'async_trait>(
&'life0 self,
edges: &'life1 [GraphEdge],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn query_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 NodeQuery,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<GraphNode>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn query_edges<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 EdgeQuery,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<GraphEdge>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_node<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<Option<GraphNode>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_edge<'life0, 'life1, 'async_trait>(
&'life0 self,
edge_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<Option<GraphEdge>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_neighbors<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
direction: EdgeDirection,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<GraphNode>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
node_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_edges<'life0, 'life1, 'async_trait>(
&'life0 self,
edge_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<StorageStats>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Graph storage trait for different storage backends
Required Methods§
Sourcefn store_graph<'life0, 'life1, 'async_trait>(
&'life0 self,
graph: &'life1 KnowledgeGraph,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_graph<'life0, 'life1, 'async_trait>(
&'life0 self,
graph: &'life1 KnowledgeGraph,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store a complete knowledge graph
Sourcefn load_graph<'life0, 'life1, 'async_trait>(
&'life0 self,
graph_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<KnowledgeGraph>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_graph<'life0, 'life1, 'async_trait>(
&'life0 self,
graph_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<KnowledgeGraph>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load a complete knowledge graph
Sourcefn store_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
nodes: &'life1 [GraphNode],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
nodes: &'life1 [GraphNode],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store individual nodes
Sourcefn store_edges<'life0, 'life1, 'async_trait>(
&'life0 self,
edges: &'life1 [GraphEdge],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_edges<'life0, 'life1, 'async_trait>(
&'life0 self,
edges: &'life1 [GraphEdge],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store individual edges
Sourcefn query_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 NodeQuery,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<GraphNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 NodeQuery,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<GraphNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query nodes by criteria
Sourcefn query_edges<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 EdgeQuery,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<GraphEdge>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_edges<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 EdgeQuery,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<GraphEdge>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query edges by criteria
Sourcefn get_node<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<Option<GraphNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_node<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<Option<GraphNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get node by ID
Sourcefn get_edge<'life0, 'life1, 'async_trait>(
&'life0 self,
edge_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<Option<GraphEdge>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_edge<'life0, 'life1, 'async_trait>(
&'life0 self,
edge_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<Option<GraphEdge>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get edge by ID
Sourcefn get_neighbors<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
direction: EdgeDirection,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<GraphNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_neighbors<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
direction: EdgeDirection,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<GraphNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get neighbors of a node
Sourcefn delete_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
node_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
node_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete nodes
Sourcefn delete_edges<'life0, 'life1, 'async_trait>(
&'life0 self,
edge_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_edges<'life0, 'life1, 'async_trait>(
&'life0 self,
edge_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete edges
Sourcefn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clear all data
Sourcefn get_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<StorageStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<StorageStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get storage statistics