pub trait FallibleObserver: Send + Sync {
// Required method
fn try_handle_event(&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§
Sourcefn try_handle_event(&self, event: &AgentEvent) -> Result<(), ReportError>
fn try_handle_event(&self, event: &AgentEvent) -> Result<(), ReportError>
Process an event, returning an error if something goes wrong.
Implementations store mutable state behind interior mutability so the
wrapper can be shared as Arc<dyn LoopObserver>.