Skip to main content

AsyncGraphStore

Trait AsyncGraphStore 

Source
pub trait AsyncGraphStore: Send + Sync {
    type Node: Send + Sync;
    type Edge: Send + Sync;
    type Error: Error + Send + Sync + 'static;

Show 15 methods // Required methods fn add_node<'life0, 'async_trait>( &'life0 mut self, node: Self::Node, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn add_edge<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, from_id: &'life1 str, to_id: &'life2 str, edge: Self::Edge, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn find_nodes<'life0, 'life1, 'async_trait>( &'life0 self, criteria: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Node>>> + 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, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Node>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn traverse<'life0, 'life1, 'async_trait>( &'life0 self, start_id: &'life1 str, max_depth: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Node>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn stats<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = GraphStats> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided methods fn add_nodes_batch<'life0, 'async_trait>( &'life0 mut self, nodes: Vec<Self::Node>, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn add_edges_batch<'life0, 'async_trait>( &'life0 mut self, edges: Vec<(String, String, Self::Edge)>, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn find_nodes_batch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, criteria_list: &'life1 [&'life2 str], ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<Self::Node>>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn get_neighbors_batch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, node_ids: &'life1 [&'life2 str], ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<Self::Node>>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn traverse_batch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, start_ids: &'life1 [&'life2 str], max_depth: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<Self::Node>>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn health_check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn optimize<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn export<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn import<'life0, 'life1, 'async_trait>( &'life0 mut self, data: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... }
}
Expand description

Async graph operations abstraction for non-blocking graph management

§Async Version

This trait provides async operations for graph management with better scalability for large graphs.

Required Associated Types§

Source

type Node: Send + Sync

The node type this graph store handles

Source

type Edge: Send + Sync

The edge type this graph store handles

Source

type Error: Error + Send + Sync + 'static

The error type returned by graph operations

Required Methods§

Source

fn add_node<'life0, 'async_trait>( &'life0 mut self, node: Self::Node, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add a node to the graph

Source

fn add_edge<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, from_id: &'life1 str, to_id: &'life2 str, edge: Self::Edge, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Add an edge between two nodes

Source

fn find_nodes<'life0, 'life1, 'async_trait>( &'life0 self, criteria: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Node>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Find nodes by criteria

Source

fn get_neighbors<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Node>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get neighbors of a node

Source

fn traverse<'life0, 'life1, 'async_trait>( &'life0 self, start_id: &'life1 str, max_depth: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Node>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Perform graph traversal

Source

fn stats<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = GraphStats> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get graph statistics

Provided Methods§

Source

fn add_nodes_batch<'life0, 'async_trait>( &'life0 mut self, nodes: Vec<Self::Node>, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add multiple nodes in batch

Source

fn add_edges_batch<'life0, 'async_trait>( &'life0 mut self, edges: Vec<(String, String, Self::Edge)>, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add multiple edges in batch

Source

fn find_nodes_batch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, criteria_list: &'life1 [&'life2 str], ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<Self::Node>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Find nodes by multiple criteria concurrently

Source

fn get_neighbors_batch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, node_ids: &'life1 [&'life2 str], ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<Self::Node>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get neighbors of multiple nodes

Source

fn traverse_batch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, start_ids: &'life1 [&'life2 str], max_depth: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<Self::Node>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Perform multiple graph traversals concurrently

Source

fn health_check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Health check for graph store

Source

fn optimize<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Optimize graph structure (rebuild indices, etc.)

Source

fn export<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Export graph data

Source

fn import<'life0, 'life1, 'async_trait>( &'life0 mut self, data: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Import graph data

Implementors§