pub struct OverlayState {
pub added_edges: Vec<OverlayEdge>,
pub tombstoned_edges: BTreeSet<u32>,
pub tombstoned_nodes: BTreeSet<u32>,
/* private fields */
}Expand description
Mutable overlay state for sync replay and query freshness.
Fields§
§added_edges: Vec<OverlayEdge>Edges inserted after the base artifact was published.
tombstoned_edges: BTreeSet<u32>Base edge ids tombstoned by sync events.
tombstoned_nodes: BTreeSet<u32>Node ids hidden from traversal results.
Implementations§
Source§impl OverlayState
impl OverlayState
Sourcepub fn has_edge_tombstones(&self) -> bool
pub fn has_edge_tombstones(&self) -> bool
Returns whether any base edge tombstones are recorded.
Sourcepub fn has_node_tombstones(&self) -> bool
pub fn has_node_tombstones(&self) -> bool
Returns whether any node tombstones are recorded.
Sourcepub fn edge_visible(&self, edge_id: u32) -> bool
pub fn edge_visible(&self, edge_id: u32) -> bool
Returns whether an edge id is visible to traversal.
§Performance
This method is O(log t) for t tombstoned edge ids.
Sourcepub fn node_visible(&self, node_id: u32) -> bool
pub fn node_visible(&self, node_id: u32) -> bool
Returns whether a node id is visible to traversal.
§Performance
This method is O(log t) for t tombstoned node ids.
Sourcepub fn push_edge(&mut self, edge: OverlayEdge)
pub fn push_edge(&mut self, edge: OverlayEdge)
Records an overlay edge and updates adjacency indexes.
§Performance
This method is O(log s + log t) for index map sizes s and t.
Sourcepub fn overlay_targets(&self, source: u32) -> &[u32]
pub fn overlay_targets(&self, source: u32) -> &[u32]
Returns overlay outgoing targets for source (empty when none).
§Performance
This method is O(log s) for s indexed sources.
Sourcepub fn overlay_sources(&self, target: u32) -> &[u32]
pub fn overlay_sources(&self, target: u32) -> &[u32]
Returns overlay incoming sources for target (empty when none).
§Performance
This method is O(log t) for t indexed targets.
Sourcepub fn remove_edge(&mut self, source: u32, target: u32)
pub fn remove_edge(&mut self, source: u32, target: u32)
Removes one overlay edge and rebuilds adjacency indexes.
§Performance
This method is O(a) for a overlay edges.
Sourcepub fn rebuild_indexes(&mut self)
pub fn rebuild_indexes(&mut self)
Rebuilds by_source / by_target from added_edges.
§Performance
This method is O(a) for a overlay edges.
Trait Implementations§
Source§impl Clone for OverlayState
impl Clone for OverlayState
Source§fn clone(&self) -> OverlayState
fn clone(&self) -> OverlayState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OverlayState
impl Debug for OverlayState
Source§impl Default for OverlayState
impl Default for OverlayState
Source§fn default() -> OverlayState
fn default() -> OverlayState
Source§impl PartialEq for OverlayState
impl PartialEq for OverlayState
Source§fn eq(&self, other: &OverlayState) -> bool
fn eq(&self, other: &OverlayState) -> bool
self and other values to be equal, and is used by ==.