pub trait StorageBackend: Send + Sync {
// Required methods
fn store_node(&self, node: &Node) -> Result<()>;
fn get_node(&self, id: &NodeId) -> Result<Option<Node>>;
fn delete_node(&self, id: &NodeId) -> Result<()>;
fn store_edge(&self, edge: &Edge) -> Result<()>;
fn get_edge(&self, id: &EdgeId) -> Result<Option<Edge>>;
fn delete_edge(&self, id: &EdgeId) -> Result<()>;
fn get_session_nodes(&self, session_id: &SessionId) -> Result<Vec<Node>>;
fn get_outgoing_edges(&self, node_id: &NodeId) -> Result<Vec<Edge>>;
fn get_incoming_edges(&self, node_id: &NodeId) -> Result<Vec<Edge>>;
fn flush(&self) -> Result<()>;
fn stats(&self) -> Result<StorageStats>;
}Expand description
Trait defining storage backend operations
Required Methods§
Sourcefn store_node(&self, node: &Node) -> Result<()>
fn store_node(&self, node: &Node) -> Result<()>
Store a node in the backend
Sourcefn delete_node(&self, id: &NodeId) -> Result<()>
fn delete_node(&self, id: &NodeId) -> Result<()>
Delete a node
Sourcefn store_edge(&self, edge: &Edge) -> Result<()>
fn store_edge(&self, edge: &Edge) -> Result<()>
Store an edge
Sourcefn delete_edge(&self, id: &EdgeId) -> Result<()>
fn delete_edge(&self, id: &EdgeId) -> Result<()>
Delete an edge
Sourcefn get_session_nodes(&self, session_id: &SessionId) -> Result<Vec<Node>>
fn get_session_nodes(&self, session_id: &SessionId) -> Result<Vec<Node>>
Get all nodes in a session
Sourcefn stats(&self) -> Result<StorageStats>
fn stats(&self) -> Result<StorageStats>
Get storage statistics