Struct cqrs_es2::EventContext [−][src]
pub struct EventContext<C: ICommand, E: IEvent> {
pub aggregate_id: String,
pub sequence: i64,
pub payload: E,
pub metadata: HashMap<String, String>,
// some fields omitted
}
Expand description
EventContext
is a data structure that encapsulates an event
with along with it’s pertinent information. All of the associated
data will be transported and persisted together.
Within any system an event must be unique based on its’
aggregate_type
, aggregate_id
and sequence
.
Fields
aggregate_id: String
The id of the aggregate instance.
sequence: i64
The sequence number for an aggregate instance.
payload: E
The event payload with all business information.
metadata: HashMap<String, String>
Additional metadata for use in auditing, logging or debugging purposes.
Implementations
Trait Implementations
impl<C: PartialEq + ICommand, E: PartialEq + IEvent> PartialEq<EventContext<C, E>> for EventContext<C, E>
impl<C: PartialEq + ICommand, E: PartialEq + IEvent> PartialEq<EventContext<C, E>> for EventContext<C, E>
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<C, E> RefUnwindSafe for EventContext<C, E> where
C: RefUnwindSafe,
E: RefUnwindSafe,
impl<C, E> Send for EventContext<C, E>
impl<C, E> Sync for EventContext<C, E>
impl<C, E> Unpin for EventContext<C, E> where
C: Unpin,
E: Unpin,
impl<C, E> UnwindSafe for EventContext<C, E> where
C: UnwindSafe,
E: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more