pub struct DependencyGraph { /* private fields */ }Expand description
Dependency graph for mutation ordering
Implementations§
Source§impl DependencyGraph
impl DependencyGraph
pub fn new() -> Self
Sourcepub fn add_dependency(&mut self, from: usize, to: usize)
pub fn add_dependency(&mut self, from: usize, to: usize)
Add dependency: from depends on to (to must complete before from)
Sourcepub fn dependencies_of(&self, idx: usize) -> &[usize]
pub fn dependencies_of(&self, idx: usize) -> &[usize]
Get all dependencies for a mutation
Sourcepub fn is_ready(&self, idx: usize, completed: &HashSet<usize>) -> bool
pub fn is_ready(&self, idx: usize, completed: &HashSet<usize>) -> bool
Check if mutation is ready (all dependencies completed)
Sourcepub fn ready_set(&self, total: usize, completed: &HashSet<usize>) -> Vec<usize>
pub fn ready_set(&self, total: usize, completed: &HashSet<usize>) -> Vec<usize>
Get all mutations ready to execute
Sourcepub fn has_ordering(&self, indices: &[usize]) -> bool
pub fn has_ordering(&self, indices: &[usize]) -> bool
Check if there’s an ordering between any pair of indices
Sourcepub fn depends_on(&self, a: usize, b: usize) -> bool
pub fn depends_on(&self, a: usize, b: usize) -> bool
Check if a depends on b (directly or transitively)
Sourcepub fn critical_path_length(&self, total: usize) -> usize
pub fn critical_path_length(&self, total: usize) -> usize
Calculate critical path length
Trait Implementations§
Source§impl Clone for DependencyGraph
impl Clone for DependencyGraph
Source§fn clone(&self) -> DependencyGraph
fn clone(&self) -> DependencyGraph
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DependencyGraph
impl Debug for DependencyGraph
Source§impl Default for DependencyGraph
impl Default for DependencyGraph
Source§fn default() -> DependencyGraph
fn default() -> DependencyGraph
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DependencyGraph
impl RefUnwindSafe for DependencyGraph
impl Send for DependencyGraph
impl Sync for DependencyGraph
impl Unpin for DependencyGraph
impl UnsafeUnpin for DependencyGraph
impl UnwindSafe for DependencyGraph
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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