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§
Required Methods§
Sourcefn 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_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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Provided Methods§
Sourcefn 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_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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn optimize<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 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,
Optimize graph structure (rebuild indices, etc.)