pub trait Event:
Send
+ Sync
+ Debug {
// Required methods
fn source(&self) -> &str;
fn correlation_id(&self) -> Option<&str>;
fn set_correlation_id(&mut self, id: String);
fn as_any(&self) -> &dyn Any;
fn clone_box(&self) -> Box<dyn Event>;
}Expand description
Base trait for all events in the agent system.
Events are used to communicate between agents in an asynchronous manner. Each event has a source (the agent that created it) and optionally a correlation_id to track related events through a workflow.
Required Methods§
Sourcefn correlation_id(&self) -> Option<&str>
fn correlation_id(&self) -> Option<&str>
Returns the correlation ID if set
Sourcefn set_correlation_id(&mut self, id: String)
fn set_correlation_id(&mut self, id: String)
Sets the correlation ID