Skip to main content

FallibleObserver

Trait FallibleObserver 

Source
pub trait FallibleObserver: Send {
    // Required method
    fn try_handle_event(
        &mut self,
        event: &AgentEvent,
    ) -> Result<(), ReportError>;
}
Expand description

A reporter whose event handling can fail.

Implement this trait for reporters that perform I/O or other fallible operations. Wrap the implementation in PolicyReporter to obtain a LoopObserver with configurable error handling.

Required Methods§

Source

fn try_handle_event(&mut self, event: &AgentEvent) -> Result<(), ReportError>

Process an event, returning an error if something goes wrong.

Implementors§