pub trait Event:
Send
+ Sync
+ Debug {
// Required methods
fn event_type(&self) -> &'static str;
fn source(&self) -> &str;
fn metadata(&self) -> &Metadata;
fn as_any(&self) -> &dyn Any;
// Provided methods
fn timestamp(&self) -> DateTime<Utc> { ... }
fn correlation_id(&self) -> Option<Uuid> { ... }
fn priority(&self) -> EventPriority { ... }
fn should_persist(&self) -> bool { ... }
}
Expand description
Base event trait that all events must implement
Required Methods§
Sourcefn event_type(&self) -> &'static str
fn event_type(&self) -> &'static str
Get the event type identifier
Provided Methods§
Sourcefn correlation_id(&self) -> Option<Uuid>
fn correlation_id(&self) -> Option<Uuid>
Get event correlation ID if available
Sourcefn priority(&self) -> EventPriority
fn priority(&self) -> EventPriority
Get event priority (default is normal)
Sourcefn should_persist(&self) -> bool
fn should_persist(&self) -> bool
Whether this event should be persisted