pub struct EvaluationSchedule {
pub layers: Vec<Vec<String>>,
}Expand description
A layered evaluation schedule derived from a RuleDependencyGraph.
Layer 0 contains all rules that have no dependencies. Layer k contains all rules whose dependencies are entirely contained in layers 0 … k-1.
Within each layer, rules can in principle be evaluated in parallel because they are independent of each other.
Fields§
§layers: Vec<Vec<String>>Rules grouped by evaluation layer.
layers[0] holds rules with no dependencies; layers[k] holds rules
whose latest dependency is in layer k-1.
Implementations§
Source§impl EvaluationSchedule
impl EvaluationSchedule
Sourcepub fn build(graph: &RuleDependencyGraph) -> Result<Self, DepError>
pub fn build(graph: &RuleDependencyGraph) -> Result<Self, DepError>
Build an EvaluationSchedule from a RuleDependencyGraph.
The implementation performs a BFS / Kahn-style traversal and assigns each rule to the layer immediately after its deepest dependency.
§Errors
Propagates DepError::CycleDetected if the graph contains a cycle.
Sourcepub fn layer_count(&self) -> usize
pub fn layer_count(&self) -> usize
Return the number of evaluation layers.
Sourcepub fn total_rules(&self) -> usize
pub fn total_rules(&self) -> usize
Return the total number of rules across all layers.
Trait Implementations§
Source§impl Clone for EvaluationSchedule
impl Clone for EvaluationSchedule
Source§fn clone(&self) -> EvaluationSchedule
fn clone(&self) -> EvaluationSchedule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for EvaluationSchedule
impl RefUnwindSafe for EvaluationSchedule
impl Send for EvaluationSchedule
impl Sync for EvaluationSchedule
impl Unpin for EvaluationSchedule
impl UnsafeUnpin for EvaluationSchedule
impl UnwindSafe for EvaluationSchedule
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
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>
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