pub struct SnapshotState {
pub outgoing: HashMap<NodeId, Vec<NodeId>>,
pub incoming: HashMap<NodeId, Vec<NodeId>>,
pub created_at: SystemTime,
}Expand description
Immutable snapshot state containing cloned adjacency data
This structure stores complete copies of adjacency maps to ensure true isolation - snapshots are unaffected by subsequent writes.
Fields§
§outgoing: HashMap<NodeId, Vec<NodeId>>Immutable copy of outgoing adjacency map
incoming: HashMap<NodeId, Vec<NodeId>>Immutable copy of incoming adjacency map
created_at: SystemTimeSnapshot creation timestamp for debugging
Implementations§
Source§impl SnapshotState
impl SnapshotState
Sourcepub fn new(
outgoing: &HashMap<NodeId, Vec<NodeId>>,
incoming: &HashMap<NodeId, Vec<NodeId>>,
) -> Self
pub fn new( outgoing: &HashMap<NodeId, Vec<NodeId>>, incoming: &HashMap<NodeId, Vec<NodeId>>, ) -> Self
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
Trait Implementations§
Source§impl Clone for SnapshotState
impl Clone for SnapshotState
Source§fn clone(&self) -> SnapshotState
fn clone(&self) -> SnapshotState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SnapshotState
impl RefUnwindSafe for SnapshotState
impl Send for SnapshotState
impl Sync for SnapshotState
impl Unpin for SnapshotState
impl UnwindSafe for SnapshotState
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