Skip to main content

EventObserver

Trait EventObserver 

Source
pub trait EventObserver: Plugin {
    // Required method
    fn on_event<'life0, 'life1, 'async_trait>(
        &'life0 self,
        event: &'life1 AgentEvent,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Pure observation hook. Logs, telemetry, replay writers. Cannot change loop state — the event sink (crate::event::EventSink) is the formal channel; this trait exists so plugins can subscribe declaratively alongside their other hooks instead of wiring a separate sink.

Required Methods§

Source

fn on_event<'life0, 'life1, 'async_trait>( &'life0 self, event: &'life1 AgentEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§