pub struct DependencyOrder<C> { /* private fields */ }Expand description
An owned snapshot of each cell’s longest dependency path measured in guard edges.
Method-only strongly connected components share a depth. Cells unreachable from guard edges have depth zero. Constant methods add no dependency edges.
§Examples
Implementations§
Source§impl<C: Copy + Eq + Hash> DependencyOrder<C>
impl<C: Copy + Eq + Hash> DependencyOrder<C>
Sourcepub fn guard_depth(&self, cell: C) -> usize
pub fn guard_depth(&self, cell: C) -> usize
Returns the cell’s longest incoming dependency path measured in guard edges.
- Precondition:
cellbelongs to the graph that produced this order. - Complexity: Expected O(1) time, excluding key hashing and equality costs.
§Examples
use adam_rs::dependency::DependencyGraph;
let mut graph = DependencyGraph::<_, ()>::new([0, 1, 2]);
graph.add_guard(0, 1);
graph.add_guard(1, 2);
let order = graph.analyze().unwrap();
assert_eq!(order.guard_depth(0), 0);
assert_eq!(order.guard_depth(2), 2);Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for DependencyOrder<C>
impl<C> RefUnwindSafe for DependencyOrder<C>where
C: RefUnwindSafe,
impl<C> Send for DependencyOrder<C>where
C: Send,
impl<C> Sync for DependencyOrder<C>where
C: Sync,
impl<C> Unpin for DependencyOrder<C>where
C: Unpin,
impl<C> UnsafeUnpin for DependencyOrder<C>
impl<C> UnwindSafe for DependencyOrder<C>where
C: 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