pub struct DeltaEdgeSlab { /* private fields */ }Expand description
Delta slab for accumulating edge mutations between CSR rebuilds
Provides O(1) edge mutations by tracking additions and removals separately, merging them with the base CSR on read.
Implementations§
Source§impl DeltaEdgeSlab
impl DeltaEdgeSlab
Sourcepub fn remove_edge(&mut self, from: VertexId, to: VertexId)
pub fn remove_edge(&mut self, from: VertexId, to: VertexId)
Remove an edge from source to target
Sourcepub fn merged_view(&self, csr: &CsrEdges, v: VertexId) -> Vec<VertexId>
pub fn merged_view(&self, csr: &CsrEdges, v: VertexId) -> Vec<VertexId>
Get a merged view of edges for a vertex, combining CSR and delta
Sourcepub fn merged_in_view(&self, csr: &CsrEdges, v: VertexId) -> Vec<VertexId>
pub fn merged_in_view(&self, csr: &CsrEdges, v: VertexId) -> Vec<VertexId>
Get a merged view of incoming edges for a vertex, combining the CSR reverse edges with the delta’s reverse index. O(in-degree), not O(V).
Sourcepub fn needs_rebuild(&self) -> bool
pub fn needs_rebuild(&self) -> bool
Check if the delta needs to be applied (rebuild threshold reached)
Sourcepub fn mark_dirty(&mut self)
pub fn mark_dirty(&mut self)
Mark that coordinates have changed and rebuild is needed
Sourcepub fn additions_iter(
&self,
) -> impl Iterator<Item = (&VertexId, &FxHashSet<VertexId>)>
pub fn additions_iter( &self, ) -> impl Iterator<Item = (&VertexId, &FxHashSet<VertexId>)>
Iterate over all (from, &additions) pairs in the delta. Used by build_from_adjacency to carry forward delta-only edges that the adjacency input does not cover.
Sourcepub fn removals_for(
&self,
from: VertexId,
) -> impl Iterator<Item = VertexId> + '_
pub fn removals_for( &self, from: VertexId, ) -> impl Iterator<Item = VertexId> + '_
Return removals scheduled for from (empty slice if none).
Trait Implementations§
Source§impl Debug for DeltaEdgeSlab
impl Debug for DeltaEdgeSlab
Auto Trait Implementations§
impl Freeze for DeltaEdgeSlab
impl RefUnwindSafe for DeltaEdgeSlab
impl Send for DeltaEdgeSlab
impl Sync for DeltaEdgeSlab
impl Unpin for DeltaEdgeSlab
impl UnsafeUnpin for DeltaEdgeSlab
impl UnwindSafe for DeltaEdgeSlab
Blanket Implementations§
impl<T> Allocation for T
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
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>
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>
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