pub struct RuleDependencyGraph { /* private fields */ }Expand description
Rule dependency graph
Implementations§
Source§impl RuleDependencyGraph
impl RuleDependencyGraph
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 a dependency: rule from depends on rule to
Sourcepub fn topological_sort(&self) -> Result<Vec<usize>>
pub fn topological_sort(&self) -> Result<Vec<usize>>
Get rules in topological order (dependencies first) When rule A depends on rule B, B should appear before A in the result
Sourcepub fn detect_cycles(&self) -> Vec<Vec<usize>>
pub fn detect_cycles(&self) -> Vec<Vec<usize>>
Detect strongly connected components (cycles)
Sourcepub fn find_parallel_groups(&self) -> Vec<Vec<usize>>
pub fn find_parallel_groups(&self) -> Vec<Vec<usize>>
Get rules that can be executed in parallel
Trait Implementations§
Source§impl Clone for RuleDependencyGraph
impl Clone for RuleDependencyGraph
Source§impl Debug for RuleDependencyGraph
impl Debug for RuleDependencyGraph
Auto Trait Implementations§
impl Freeze for RuleDependencyGraph
impl RefUnwindSafe for RuleDependencyGraph
impl Send for RuleDependencyGraph
impl Sync for RuleDependencyGraph
impl Unpin for RuleDependencyGraph
impl UnsafeUnpin for RuleDependencyGraph
impl UnwindSafe for RuleDependencyGraph
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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