pub trait CuMonitor: Sized {
// Required methods
fn new(
config: &CuConfig,
taskids: &'static [&'static str],
) -> Result<Self, CuError>
where Self: Sized;
fn process_copperlist(
&self,
_ctx: &CuContext,
msgs: &[&CuMsgMetadata],
) -> Result<(), CuError>;
fn process_error(
&self,
taskid: usize,
step: CuTaskState,
error: &CuError,
) -> Decision;
// Provided methods
fn set_topology(&mut self, _topology: MonitorTopology) { ... }
fn set_copperlist_info(&mut self, _info: CopperListInfo) { ... }
fn set_execution_probe(&mut self, _probe: Arc<RuntimeExecutionProbe>) { ... }
fn start(&mut self, _ctx: &CuContext) -> Result<(), CuError> { ... }
fn observe_copperlist_io(&self, _stats: CopperListIoStats) { ... }
fn process_panic(&self, _panic_message: &str) { ... }
fn stop(&mut self, _ctx: &CuContext) -> 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,
_ctx: &CuContext,
msgs: &[&CuMsgMetadata],
) -> Result<(), CuError>
fn process_copperlist( &self, _ctx: &CuContext, 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§
fn set_topology(&mut self, _topology: MonitorTopology)
fn set_copperlist_info(&mut self, _info: CopperListInfo)
fn set_execution_probe(&mut self, _probe: Arc<RuntimeExecutionProbe>)
fn start(&mut self, _ctx: &CuContext) -> Result<(), CuError>
Sourcefn observe_copperlist_io(&self, _stats: CopperListIoStats)
fn observe_copperlist_io(&self, _stats: CopperListIoStats)
Called when the runtime finishes serializing a CopperList, giving IO accounting data.
Sourcefn process_panic(&self, _panic_message: &str)
fn process_panic(&self, _panic_message: &str)
Callback fired when the runtime catches a panic in a std build.
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.