pub struct NativeGraphBackend { /* private fields */ }Expand description
Native backend implementation using interior mutability
Implementations§
Trait Implementations§
Source§impl GraphBackend for NativeGraphBackend
impl GraphBackend for NativeGraphBackend
fn insert_node(&self, node: NodeSpec) -> Result<i64, SqliteGraphError>
fn get_node( &self, snapshot_id: SnapshotId, id: i64, ) -> Result<GraphEntity, SqliteGraphError>
fn insert_edge(&self, edge: EdgeSpec) -> Result<i64, SqliteGraphError>
Source§fn update_node(
&self,
node_id: i64,
node: NodeSpec,
) -> Result<i64, SqliteGraphError>
fn update_node( &self, node_id: i64, node: NodeSpec, ) -> Result<i64, SqliteGraphError>
Update an existing node in place without allocating a new node ID Read more
Source§fn delete_entity(&self, id: i64) -> Result<(), SqliteGraphError>
fn delete_entity(&self, id: i64) -> Result<(), SqliteGraphError>
Delete an entity (node) from the graph by ID Read more
Source§fn entity_ids(&self) -> Result<Vec<i64>, SqliteGraphError>
fn entity_ids(&self) -> Result<Vec<i64>, SqliteGraphError>
Get all entity IDs from the graph Read more
fn neighbors( &self, snapshot_id: SnapshotId, node: i64, query: NeighborQuery, ) -> Result<Vec<i64>, SqliteGraphError>
fn bfs( &self, snapshot_id: SnapshotId, start: i64, depth: u32, ) -> Result<Vec<i64>, SqliteGraphError>
fn shortest_path( &self, snapshot_id: SnapshotId, start: i64, end: i64, ) -> Result<Option<Vec<i64>>, SqliteGraphError>
fn node_degree( &self, snapshot_id: SnapshotId, node: i64, ) -> Result<(usize, usize), SqliteGraphError>
fn k_hop( &self, snapshot_id: SnapshotId, start: i64, depth: u32, direction: BackendDirection, ) -> Result<Vec<i64>, SqliteGraphError>
fn k_hop_filtered( &self, snapshot_id: SnapshotId, start: i64, depth: u32, direction: BackendDirection, allowed_edge_types: &[&str], ) -> Result<Vec<i64>, SqliteGraphError>
fn chain_query( &self, snapshot_id: SnapshotId, start: i64, chain: &[ChainStep], ) -> Result<Vec<i64>, SqliteGraphError>
fn pattern_search( &self, snapshot_id: SnapshotId, start: i64, pattern: &PatternQuery, ) -> Result<Vec<PatternMatch>, SqliteGraphError>
Source§fn checkpoint(&self) -> Result<(), SqliteGraphError>
fn checkpoint(&self) -> Result<(), SqliteGraphError>
Trigger WAL checkpoint for backends that support write-ahead logging Read more
Source§fn flush(&self) -> Result<(), SqliteGraphError>
fn flush(&self) -> Result<(), SqliteGraphError>
Force immediate flush of WAL buffer to disk Read more
Source§fn snapshot_export(
&self,
export_dir: &Path,
) -> Result<SnapshotMetadata, SqliteGraphError>
fn snapshot_export( &self, export_dir: &Path, ) -> Result<SnapshotMetadata, SqliteGraphError>
Export database snapshot to the specified directory Read more
Source§fn backup(&self, backup_dir: &Path) -> Result<BackupResult, SqliteGraphError>
fn backup(&self, backup_dir: &Path) -> Result<BackupResult, SqliteGraphError>
Create a backup of the database Read more
Source§fn snapshot_import(
&self,
import_dir: &Path,
) -> Result<ImportMetadata, SqliteGraphError>
fn snapshot_import( &self, import_dir: &Path, ) -> Result<ImportMetadata, SqliteGraphError>
Import database snapshot from the specified directory Read more
Source§fn query_nodes_by_kind(
&self,
_snapshot_id: SnapshotId,
kind: &str,
) -> Result<Vec<i64>, SqliteGraphError>
fn query_nodes_by_kind( &self, _snapshot_id: SnapshotId, kind: &str, ) -> Result<Vec<i64>, SqliteGraphError>
Query all nodes with a given kind Read more
Source§fn query_nodes_by_name_pattern(
&self,
_snapshot_id: SnapshotId,
pattern: &str,
) -> Result<Vec<i64>, SqliteGraphError>
fn query_nodes_by_name_pattern( &self, _snapshot_id: SnapshotId, pattern: &str, ) -> Result<Vec<i64>, SqliteGraphError>
Query nodes by name pattern using glob matching Read more
Source§fn all_entity_ids(&self) -> Result<Vec<i64>, SqliteGraphError>
fn all_entity_ids(&self) -> Result<Vec<i64>, SqliteGraphError>
Alias for
entity_ids() for backward compatibility with algorithms Read moreSource§fn fetch_outgoing(&self, node: i64) -> Result<Vec<i64>, SqliteGraphError>
fn fetch_outgoing(&self, node: i64) -> Result<Vec<i64>, SqliteGraphError>
Get outgoing neighbors for a node (convenience method) Read more
Source§fn fetch_incoming(&self, node: i64) -> Result<Vec<i64>, SqliteGraphError>
fn fetch_incoming(&self, node: i64) -> Result<Vec<i64>, SqliteGraphError>
Get incoming neighbors for a node (convenience method) Read more
Source§fn subscribe(
&self,
_filter: SubscriptionFilter,
) -> Result<(u64, Receiver<PubSubEvent>), SqliteGraphError>
fn subscribe( &self, _filter: SubscriptionFilter, ) -> Result<(u64, Receiver<PubSubEvent>), SqliteGraphError>
Subscribe to graph change events Read more
Source§fn unsubscribe(&self, _subscriber_id: u64) -> Result<bool, SqliteGraphError>
fn unsubscribe(&self, _subscriber_id: u64) -> Result<bool, SqliteGraphError>
Unsubscribe from events Read more
Auto Trait Implementations§
impl !Freeze for NativeGraphBackend
impl !RefUnwindSafe for NativeGraphBackend
impl Send for NativeGraphBackend
impl Sync for NativeGraphBackend
impl Unpin for NativeGraphBackend
impl UnwindSafe for NativeGraphBackend
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more