Struct esrs::store::StoreEvent
source · pub struct StoreEvent<Event> {
pub id: Uuid,
pub aggregate_id: Uuid,
pub payload: Event,
pub occurred_on: DateTime<Utc>,
pub sequence_number: SequenceNumber,
pub version: Option<i32>,
}
Expand description
A StoreEvent
contains the payload (the original event) alongside the event’s metadata.
Fields§
§id: Uuid
Uniquely identifies an event among all events emitted from all aggregates.
aggregate_id: Uuid
The aggregate instance that emitted the event.
payload: Event
The original, emitted, event.
occurred_on: DateTime<Utc>
The timestamp of when the event is persisted.
sequence_number: SequenceNumber
The sequence number of the event, within its specific aggregate instance.
version: Option<i32>
The version of the event.
Implementations§
source§impl<Event> StoreEvent<Event>
impl<Event> StoreEvent<Event>
sourcepub const fn sequence_number(&self) -> &SequenceNumber
pub const fn sequence_number(&self) -> &SequenceNumber
Returns the sequence number of the event, within its specific aggregate instance.
Trait Implementations§
source§impl<Event: Debug> Debug for StoreEvent<Event>
impl<Event: Debug> Debug for StoreEvent<Event>
source§impl<'de, Event> Deserialize<'de> for StoreEvent<Event>where
Event: Deserialize<'de>,
impl<'de, Event> Deserialize<'de> for StoreEvent<Event>where
Event: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<Event> Serialize for StoreEvent<Event>where
Event: Serialize,
impl<Event> Serialize for StoreEvent<Event>where
Event: Serialize,
source§impl<E: Persistable> TryInto<StoreEvent<E>> for DbEvent
impl<E: Persistable> TryInto<StoreEvent<E>> for DbEvent
Auto Trait Implementations§
impl<Event> Freeze for StoreEvent<Event>where
Event: Freeze,
impl<Event> RefUnwindSafe for StoreEvent<Event>where
Event: RefUnwindSafe,
impl<Event> Send for StoreEvent<Event>where
Event: Send,
impl<Event> Sync for StoreEvent<Event>where
Event: Sync,
impl<Event> Unpin for StoreEvent<Event>where
Event: Unpin,
impl<Event> UnwindSafe for StoreEvent<Event>where
Event: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more