Skip to main content

PlanTask

Trait PlanTask 

Source
pub trait PlanTask: Sync {
    // Required methods
    fn is_canceled(&self) -> bool;
    fn delegation_started(&self, launch: &DelegationLaunch);
    fn delegation_settled(&self, delegation_id: &str) -> bool;
}
Expand description

The task a plan runs for, as the scheduler sees it: whether it has been cancelled, and the set that accounts for every sub-capsule the task starts.

One rule keeps a capsule step’s terminal delegation line single: whoever takes the step’s row out of the task’s set writes it. A step that ends on its own takes the row through PlanTask::delegation_settled; a step whose task was cancelled leaves it, and the task closes it after its task_canceled.

Required Methods§

Source

fn is_canceled(&self) -> bool

Whether the task this plan runs for has been cancelled. Polled; cheap, never blocks.

Source

fn delegation_started(&self, launch: &DelegationLaunch)

A capsule step’s child is up: account for it in the task’s delegation set before it is handed its task.

Source

fn delegation_settled(&self, delegation_id: &str) -> bool

The step is closing its row. true when the row was still the step’s and the step now writes the terminal delegation line; false when the task already holds it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§