[−][src]Struct cqrs_es::EventEnvelope
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: E
The event payload with all business information.
metadata: HashMap<String, String>
Additional metadata for use in auditing, logging or debugging purposes.
Methods
impl<A, E> EventEnvelope<A, E> where
A: Aggregate,
E: DomainEvent<A>,
[src]
A: Aggregate,
E: DomainEvent<A>,
pub fn new(
aggregate_id: String,
sequence: usize,
aggregate_type: String,
payload: E
) -> Self
[src]
aggregate_id: String,
sequence: usize,
aggregate_type: String,
payload: E
) -> Self
A convenience function for packaging an event in an EventEnvelope
, used for
testing QueryProcessor
s.
pub fn new_with_metadata(
aggregate_id: String,
sequence: usize,
aggregate_type: String,
payload: E,
metadata: HashMap<String, String>
) -> Self
[src]
aggregate_id: String,
sequence: usize,
aggregate_type: String,
payload: E,
metadata: HashMap<String, String>
) -> Self
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
impl<A, E> Clone for EventEnvelope<A, E> where
A: Aggregate,
E: DomainEvent<A>,
[src]
A: Aggregate,
E: DomainEvent<A>,
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<A: Debug, E: Debug> Debug for EventEnvelope<A, E> where
A: Aggregate,
E: DomainEvent<A>,
[src]
A: Aggregate,
E: DomainEvent<A>,
Auto Trait Implementations
impl<A, E> RefUnwindSafe for EventEnvelope<A, E> where
A: RefUnwindSafe,
E: RefUnwindSafe,
A: RefUnwindSafe,
E: RefUnwindSafe,
impl<A, E> Send for EventEnvelope<A, E>
impl<A, E> Sync for EventEnvelope<A, E>
impl<A, E> Unpin for EventEnvelope<A, E> where
A: Unpin,
E: Unpin,
A: Unpin,
E: Unpin,
impl<A, E> UnwindSafe for EventEnvelope<A, E> where
A: UnwindSafe,
E: UnwindSafe,
A: UnwindSafe,
E: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,