pub struct DynamicTopo<N: Copy + Eq + Hash + Ord> { /* private fields */ }Expand description
DynamicTopo maintains a deterministic total order (pos) consistent with the conceptual DAG.
Implementations§
Source§impl<N> DynamicTopo<N>
impl<N> DynamicTopo<N>
pub fn new(nodes: impl IntoIterator<Item = N>, cfg: PkConfig) -> Self
Sourcepub fn rebuild_full<G: GraphView<N>>(&mut self, graph: &G)
pub fn rebuild_full<G: GraphView<N>>(&mut self, graph: &G)
Full rebuild via Kahn-style topological sort. Breaks ties by node Ord.
pub fn try_add_edge<G: GraphView<N>>( &mut self, graph: &G, x: N, y: N, ) -> Result<PkStats, Cycle<N>>
pub fn remove_edge(&mut self, _x: N, _y: N)
pub fn apply_bulk<G: GraphView<N>>( &mut self, graph: &G, removes: &[(N, N)], adds: &[(N, N)], ) -> Result<PkStats, Cycle<N>>
pub fn topo_order(&self) -> &[N]
pub fn compact_ranks(&mut self)
Sourcepub fn layers_for<G: GraphView<N>>(
&self,
graph: &G,
subset: &[N],
max_layer_width: Option<usize>,
) -> Vec<Vec<N>>
pub fn layers_for<G: GraphView<N>>( &self, graph: &G, subset: &[N], max_layer_width: Option<usize>, ) -> Vec<Vec<N>>
Build parallel-ready layers for a subset, using maintained order for tie-breaks.
Sourcepub fn ensure_nodes(&mut self, nodes: impl IntoIterator<Item = N>)
pub fn ensure_nodes(&mut self, nodes: impl IntoIterator<Item = N>)
Ensure that all provided nodes exist in the ordering; append any missing at the end.
Trait Implementations§
Auto Trait Implementations§
impl<N> Freeze for DynamicTopo<N>
impl<N> RefUnwindSafe for DynamicTopo<N>where
N: RefUnwindSafe,
impl<N> Send for DynamicTopo<N>where
N: Send,
impl<N> Sync for DynamicTopo<N>where
N: Sync,
impl<N> Unpin for DynamicTopo<N>where
N: Unpin,
impl<N> UnsafeUnpin for DynamicTopo<N>
impl<N> UnwindSafe for DynamicTopo<N>where
N: UnwindSafe,
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