pub struct Plan { /* private fields */ }Expand description
Immutable, topologically-layered execution plan.
Layer n holds only actions whose dependencies are all in layers 0..n,
so layers can be executed in order; actions within a single layer are
independent and may run in parallel.
Implementations§
Source§impl Plan
impl Plan
Sourcepub fn layers(&self) -> &[Vec<ActionId>]
pub fn layers(&self) -> &[Vec<ActionId>]
Topological layers, each layer’s actions independent of each other.
Sourcepub fn reasons(&self) -> &HashMap<ActionId, ChangeReason>
pub fn reasons(&self) -> &HashMap<ActionId, ChangeReason>
Map of stale action id → reason. Actions absent from the map are up-to-date.
Sourcepub fn stale(&self) -> impl Iterator<Item = &ActionId>
pub fn stale(&self) -> impl Iterator<Item = &ActionId>
Iterator over the ids of all stale actions (any reason).
Sourcepub fn flat_topo(&self) -> impl Iterator<Item = &ActionId>
pub fn flat_topo(&self) -> impl Iterator<Item = &ActionId>
Iterator over all action ids in topological order, flattening layers.
Sourcepub async fn compute(
actions: &[Box<dyn Action>],
cache: &dyn Cache,
ctx: &Ctx,
) -> Result<Self, PlanError>
pub async fn compute( actions: &[Box<dyn Action>], cache: &dyn Cache, ctx: &Ctx, ) -> Result<Self, PlanError>
Build a plan from a set of actions and a cache snapshot.
§Errors
PlanError::MissingDepwhen an action declares a dep on an unknown id.PlanError::Cyclewhen no topological order exists.PlanError::BuildwhenAction::input_hashreturns an error.
Sourcepub fn input_hash(&self, id: &ActionId) -> Option<Sha256>
pub fn input_hash(&self, id: &ActionId) -> Option<Sha256>
Pre-computed input hash for id, captured during Self::compute.
Returns None for ids not in the plan (caller error).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Plan
impl RefUnwindSafe for Plan
impl Send for Plan
impl Sync for Plan
impl Unpin for Plan
impl UnsafeUnpin for Plan
impl UnwindSafe for Plan
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