pub struct GraphSnapshot { /* private fields */ }Expand description
MVCC-lite read-only snapshot for graph data isolation.
Provides safe, read-only access to a point-in-time view of the graph with its own SQLite connection to ensure database consistency.
Implementations§
Source§impl GraphSnapshot
impl GraphSnapshot
Sourcepub fn new(state: Arc<SnapshotState>, db_path: &str) -> SqliteResult<Self>
pub fn new(state: Arc<SnapshotState>, db_path: &str) -> SqliteResult<Self>
Sourcepub fn state(&self) -> &Arc<SnapshotState>
pub fn state(&self) -> &Arc<SnapshotState>
Get the snapshot state
Sourcepub fn connection(&self) -> &Connection
pub fn connection(&self) -> &Connection
Get the read-only database connection
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Get the number of nodes in this snapshot
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Get the number of edges in this snapshot
Sourcepub fn contains_node(&self, node_id: NodeId) -> bool
pub fn contains_node(&self, node_id: NodeId) -> bool
Check if a node exists in this snapshot
Sourcepub fn get_outgoing(&self, node_id: NodeId) -> Option<&Vec<NodeId>>
pub fn get_outgoing(&self, node_id: NodeId) -> Option<&Vec<NodeId>>
Get outgoing neighbors for a node in this snapshot
Sourcepub fn get_incoming(&self, node_id: NodeId) -> Option<&Vec<NodeId>>
pub fn get_incoming(&self, node_id: NodeId) -> Option<&Vec<NodeId>>
Get incoming neighbors for a node in this snapshot
Sourcepub fn created_at(&self) -> SystemTime
pub fn created_at(&self) -> SystemTime
Get snapshot creation timestamp
Auto Trait Implementations§
impl !Freeze for GraphSnapshot
impl !RefUnwindSafe for GraphSnapshot
impl Send for GraphSnapshot
impl !Sync for GraphSnapshot
impl Unpin for GraphSnapshot
impl !UnwindSafe for GraphSnapshot
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