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§
fn new(
config: &CuConfig,
taskids: &'static [&'static str],
) -> Result<Self, CuError>where
Self: Sized,
Sourcefn process_copperlist(&self, msgs: &[&CuMsgMetadata]) -> Result<(), CuError>
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).
Sourcefn process_error(
&self,
taskid: usize,
step: CuTaskState,
error: &CuError,
) -> Decision
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§
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.