Struct cqrs_es2::EventEnvelope [−][src]
pub struct EventEnvelope<A> where
A: Aggregate, { pub aggregate_id: String, pub sequence: usize, pub aggregate_type: String, 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.
aggregate_type: String
The type of aggregate the event applies to.
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.
A convenience function for packaging an event in an
EventEnvelope
, used for testing QueryProcessor
s. This
version allows custom metadata to also be processed.
Trait Implementations
Auto Trait Implementations
impl<A> RefUnwindSafe for EventEnvelope<A> where
<A as Aggregate>::Event: RefUnwindSafe,
impl<A> Send for EventEnvelope<A>
impl<A> Sync for EventEnvelope<A>
impl<A> Unpin for EventEnvelope<A> where
<A as Aggregate>::Event: Unpin,
impl<A> UnwindSafe for EventEnvelope<A> where
<A as Aggregate>::Event: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more