Skip to main content

OnEventCallback

Type Alias OnEventCallback 

Source
pub type OnEventCallback = Box<dyn Fn(Arc<dyn InvocationContext>, Event) -> Pin<Box<dyn Future<Output = Result<Option<Event>>> + Send>> + Send + Sync>;
Expand description

Callback invoked for each event generated by the agent.

Can modify events before they are yielded. Return Ok(Some(event)) to replace the event, Ok(None) to keep original.

Aliased Typeยง

pub struct OnEventCallback(/* private fields */);