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

Constructor

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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.