Skip to main content

Meta

Struct Meta 

Source
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 to u64).
  • 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

Source

pub fn new(actor_id: ActorId, correlation_id: Option<EventId>) -> Self

Construct metadata for a given actor name and optional correlation id.

Source

pub fn id(&self) -> EventId

Unique identifier for this envelope.

Source

pub fn timestamp(&self) -> u64

Timestamp in nanoseconds since Unix epoch (u64 truncation).

Source

pub fn actor_name(&self) -> &str

Name of actor that sent the event.

Source

pub fn actor_id(&self) -> &ActorId

Source

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§

Source§

impl Clone for Meta

Source§

fn clone(&self) -> Meta

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Meta

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.