pub trait Event:
Serialize
+ Sized
+ Debug {
// Required method
fn event_key(&self) -> Result<String>;
// Provided methods
fn event_headers(&self) -> Result<HashMap<String, String>> { ... }
fn event_payload(&self) -> Result<String> { ... }
}
Expand description
Struct is an event that can be published to external systems.
Required Methods§
Provided Methods§
Sourcefn event_headers(&self) -> Result<HashMap<String, String>>
fn event_headers(&self) -> Result<HashMap<String, String>>
Returns the headers component of the event.
By default, it returns empty headers.
Sourcefn event_payload(&self) -> Result<String>
fn event_payload(&self) -> Result<String>
Returns the payload component of the event.
By default, it serializes the implementing struct as JSON.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.