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 QueryProcessors.

A convenience function for packaging an event in an EventEnvelope, used for testing QueryProcessors. This version allows custom metadata to also be processed.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.