pub struct InMemoryGraphStorage { /* private fields */ }Expand description
In-memory graph storage implementation
Implementations§
Source§impl InMemoryGraphStorage
impl InMemoryGraphStorage
Sourcepub fn with_config(config: GraphStorageConfig) -> Self
pub fn with_config(config: GraphStorageConfig) -> Self
Create with custom configuration
Trait Implementations§
Source§impl Default for InMemoryGraphStorage
impl Default for InMemoryGraphStorage
Source§impl GraphStorage for InMemoryGraphStorage
impl GraphStorage for InMemoryGraphStorage
Source§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 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
Source§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 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
Source§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_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
Source§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 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
Source§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_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
Source§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 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
Source§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_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
Source§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_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
Source§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 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
Source§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_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
Source§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 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
Source§fn 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
Source§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,
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
Auto Trait Implementations§
impl !Freeze for InMemoryGraphStorage
impl !RefUnwindSafe for InMemoryGraphStorage
impl Send for InMemoryGraphStorage
impl Sync for InMemoryGraphStorage
impl Unpin for InMemoryGraphStorage
impl !UnwindSafe for InMemoryGraphStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more