Struct cqrs_es2::EventEnvelope [−][src]
pub struct EventEnvelope<A: IAggregate> { pub aggregate_id: String, pub sequence: usize, pub payload: A::Event, pub metadata: HashMap<String, String>, }
Expand description
EventEnvelope
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: usize
The sequence number for an aggregate instance.
payload: A::Event
The event payload with all business information.
metadata: HashMap<String, String>
Additional metadata for use in auditing, logging or debugging purposes.
Implementations
A convenience function for packaging an event in an
EventEnvelope
, used for testing QueryProcessor
s.
Trait Implementations
Auto Trait Implementations
impl<A> RefUnwindSafe for EventEnvelope<A> where
<A as IAggregate>::Event: RefUnwindSafe,
impl<A> Send for EventEnvelope<A>
impl<A> Sync for EventEnvelope<A>
impl<A> Unpin for EventEnvelope<A> where
<A as IAggregate>::Event: Unpin,
impl<A> UnwindSafe for EventEnvelope<A> where
<A as IAggregate>::Event: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more