pub struct Meta { /* private fields */ }Expand description
Metadata attached to every event envelope.
id: unique identifier for the envelope.timestamp: creation time in nanoseconds since Unix epoch (truncated tou64).actor_name: actor name emitting the event.correlation_id: optional id to link related events together. Useful for tracing and debugging event flows.
There is no logic at Maiko built around the correlation_id, so the value doesn’t
have any special meaning to the runtime. It’s up to the user to set and interpret it.
For example, an actor may choose to set the correlation_id of child events, but
it may also have another meaning in a different context.
Implementations§
Source§impl Meta
impl Meta
Sourcepub fn new(actor_id: ActorId, correlation_id: Option<EventId>) -> Self
pub fn new(actor_id: ActorId, correlation_id: Option<EventId>) -> Self
Construct metadata for a given actor name and optional correlation id.
Sourcepub fn actor_name(&self) -> &str
pub fn actor_name(&self) -> &str
Name of actor that sent the event.
pub fn actor_id(&self) -> &ActorId
Sourcepub fn correlation_id(&self) -> Option<EventId>
pub fn correlation_id(&self) -> Option<EventId>
Optional value of correlation data. It might by a parent event id, but it’s up to the user to define its meaning.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Meta
impl RefUnwindSafe for Meta
impl Send for Meta
impl Sync for Meta
impl Unpin for Meta
impl UnwindSafe for Meta
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more