Skip to main content

CuPlanner

Trait CuPlanner 

Source
pub trait CuPlanner {
    // Required methods
    fn new(config: Option<&ComponentConfig>) -> Result<Self, CuError>
       where Self: Sized;
    fn plan(&self, graph: &CuGraph) -> Result<StepOrder, CuError>;
}
Expand description

A pluggable execution planner, selected by runtime.planner in the RON config (mirroring how monitors are selected by type).

plan receives the synthetic plan graph of one mission: one node per task (Flavor::Task) and one per used bridge channel stage (Flavor::Bridge), with every connection as an edge. It returns the execution order over those nodes; the shared pipeline then rejects illegal orders (a step before one of its inputs, missing or duplicated steps) and materializes the CopperList plan.

Planners run at build time, never on the robot. Copper ships Linearity (the default) and Pinned; any crate can implement this trait and resolve through emit_plan in the application’s build.rs.

Required Methods§

Source

fn new(config: Option<&ComponentConfig>) -> Result<Self, CuError>
where Self: Sized,

Construct from the config: block of the runtime.planner section.

Source

fn plan(&self, graph: &CuGraph) -> Result<StepOrder, CuError>

Decide the step order for one mission’s plan graph.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§