cu29::prelude::monitoring

Trait CuMonitor

Source
pub trait CuMonitor: Sized {
    // Required methods
    fn new(
        config: &CuConfig,
        taskids: &'static [&'static str],
    ) -> Result<Self, CuError>
       where Self: Sized;
    fn process_copperlist(&self, msgs: &[&CuMsgMetadata]) -> Result<(), CuError>;
    fn process_error(
        &self,
        taskid: usize,
        step: CuTaskState,
        error: &CuError,
    ) -> Decision;

    // Provided methods
    fn start(&mut self, _clock: &RobotClock) -> Result<(), CuError> { ... }
    fn stop(&mut self, _clock: &RobotClock) -> Result<(), CuError> { ... }
}
Expand description

Trait to implement a monitoring task.

Required Methods§

Source

fn new( config: &CuConfig, taskids: &'static [&'static str], ) -> Result<Self, CuError>
where Self: Sized,

Source

fn process_copperlist(&self, msgs: &[&CuMsgMetadata]) -> Result<(), CuError>

Callback that will be trigger at the end of every copperlist (before, on or after the serialization).

Source

fn process_error( &self, taskid: usize, step: CuTaskState, error: &CuError, ) -> Decision

Callbacked when a Task errored out. The runtime requires an immediate decision.

Provided Methods§

Source

fn start(&mut self, _clock: &RobotClock) -> Result<(), CuError>

Source

fn stop(&mut self, _clock: &RobotClock) -> Result<(), CuError>

Callbacked when copper is stopping.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§