pub struct PersistedEventEnvelope { /* private fields */ }Expand description
Opaque persisted event data delivered by a ProjectionSource.
Implementations§
Source§impl PersistedEventEnvelope
impl PersistedEventEnvelope
Sourcepub fn new(
source_id: DeliverySourceId,
position: DeliveryPosition,
event_id: PersistedEventId,
stream_id: StreamId,
stream_version: StreamVersion,
event_type: EventTypeName,
payload: Box<RawValue>,
metadata: Box<RawValue>,
) -> PersistedEventEnvelope
pub fn new( source_id: DeliverySourceId, position: DeliveryPosition, event_id: PersistedEventId, stream_id: StreamId, stream_version: StreamVersion, event_type: EventTypeName, payload: Box<RawValue>, metadata: Box<RawValue>, ) -> PersistedEventEnvelope
Creates an envelope from validated persisted event fields and raw JSON.
Sourcepub fn source_id(&self) -> &DeliverySourceId
pub fn source_id(&self) -> &DeliverySourceId
Returns the source that produced this envelope.
Sourcepub fn position(&self) -> DeliveryPosition
pub fn position(&self) -> DeliveryPosition
Returns this envelope’s source-scoped delivery position.
Sourcepub fn event_id(&self) -> PersistedEventId
pub fn event_id(&self) -> PersistedEventId
Returns this envelope’s stable persisted event identity.
Sourcepub fn stream_version(&self) -> StreamVersion
pub fn stream_version(&self) -> StreamVersion
Returns this event’s version within its stream.
Sourcepub fn event_type(&self) -> &EventTypeName
pub fn event_type(&self) -> &EventTypeName
Returns the persisted event type discriminator.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PersistedEventEnvelope
impl RefUnwindSafe for PersistedEventEnvelope
impl Send for PersistedEventEnvelope
impl Sync for PersistedEventEnvelope
impl Unpin for PersistedEventEnvelope
impl UnsafeUnpin for PersistedEventEnvelope
impl UnwindSafe for PersistedEventEnvelope
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
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