pub struct PersistedEvent<E: EsEvent> {
pub entity_id: <E as EsEvent>::EntityId,
pub recorded_at: DateTime<Utc>,
pub sequence: usize,
pub event: E,
pub context: Option<ContextData>,
}Expand description
Strongly-typed event wrapper with metadata for successfully stored events.
Contains the event data along with persistence metadata (sequence, timestamp, entity_id).
All new_events from EntityEvents are converted to this structure once persisted to construct
entities, enabling event sourcing operations and other database operations.
Fields§
§entity_id: <E as EsEvent>::EntityIdThe identifier of the entity which the event is used to construct
recorded_at: DateTime<Utc>The timestamp which marks event persistence
sequence: usizeThe sequence number of the event in the event stream
event: EThe event itself
context: Option<ContextData>The context when the event was persisted It is only popluated if ‘event_context’ set on EsEvent
Trait Implementations§
Auto Trait Implementations§
impl<E> Freeze for PersistedEvent<E>
impl<E> RefUnwindSafe for PersistedEvent<E>
impl<E> Send for PersistedEvent<E>
impl<E> Sync for PersistedEvent<E>
impl<E> Unpin for PersistedEvent<E>
impl<E> UnwindSafe for PersistedEvent<E>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more