EventRecord

Trait EventRecord 

Source
pub trait EventRecord<E> {
    // Required methods
    fn index(&self) -> u32;
    fn recorded_at(&self) -> DateTime<Utc>;
    fn idempotency_key(&self) -> Option<String>;
    fn event(&self) -> E;
}
Expand description

Represents an event read from an EventStore.

Event stores implement this trait directly on their native row/record objects so that they don’t have to allocate and copy the data. An Aggregate will get these passed to its Aggregate::apply method.

Required Methods§

Source

fn index(&self) -> u32

Returns the zero-based sequential index of the event in its log.

Source

fn recorded_at(&self) -> DateTime<Utc>

Returns the wall-clock time when this event was recorded in the EventStore. This is for informational purposes only since clocks on different service instances using this library could be skewed.

Source

fn idempotency_key(&self) -> Option<String>

Returns the idempotency key that was used (if any) when appending this event to the log.

Source

fn event(&self) -> E

Returns the event.

Implementations on Foreign Types§

Source§

impl<E> EventRecord<E> for Row

Implementors§