pub struct Scheduler { /* private fields */ }Expand description
State machine over a parsed pipe. Construct once per run; thread
ready() / mark() calls through the dispatcher loop.
Implementations§
Source§impl Scheduler
impl Scheduler
Sourcepub fn new(pipe: &Pipe) -> Self
pub fn new(pipe: &Pipe) -> Self
Build a scheduler from a parsed pipe. Every node starts
Pending.
Sourcepub fn ready(&mut self) -> Vec<String>
pub fn ready(&mut self) -> Vec<String>
Ids currently dispatchable: Pending nodes whose
predecessors satisfy their trigger_rule. Idempotent —
promotes to Running and returns the freshly-promoted set.
Sorted for determinism.
Sourcepub fn mark(
&mut self,
id: &str,
outcome: NodeOutcome,
) -> Result<Vec<String>, SchedulerError>
pub fn mark( &mut self, id: &str, outcome: NodeOutcome, ) -> Result<Vec<String>, SchedulerError>
Record the outcome of a Running node and return the ids
that just became unblocked (whether ready-to-dispatch or
permanently blocked is a follow-up ready() / state()
inspection).
Returns Err if id is unknown or not currently Running.
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
True when no more progress is possible: every node is
Completed, Failed, or Blocked.
Auto Trait Implementations§
impl Freeze for Scheduler
impl RefUnwindSafe for Scheduler
impl Send for Scheduler
impl Sync for Scheduler
impl Unpin for Scheduler
impl UnsafeUnpin for Scheduler
impl UnwindSafe for Scheduler
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