pub struct EventEnvelopeBuilder<E: DomainEvent> { /* private fields */ }Expand description
Builder for creating event envelopes with metadata
Implementations§
Source§impl<E: DomainEvent> EventEnvelopeBuilder<E>
impl<E: DomainEvent> EventEnvelopeBuilder<E>
Sourcepub fn correlation_id(self, id: impl Into<String>) -> Self
pub fn correlation_id(self, id: impl Into<String>) -> Self
Set correlation ID
Sourcepub fn causation_id(self, id: impl Into<String>) -> Self
pub fn causation_id(self, id: impl Into<String>) -> Self
Set causation ID
Sourcepub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add metadata entry
Sourcepub fn build(self) -> EventEnvelope<E>
pub fn build(self) -> EventEnvelope<E>
Build the envelope
Auto Trait Implementations§
impl<E> Freeze for EventEnvelopeBuilder<E>where
EventEnvelope<E>: Freeze,
impl<E> RefUnwindSafe for EventEnvelopeBuilder<E>where
EventEnvelope<E>: RefUnwindSafe,
impl<E> Send for EventEnvelopeBuilder<E>where
EventEnvelope<E>: Send,
impl<E> Sync for EventEnvelopeBuilder<E>where
EventEnvelope<E>: Sync,
impl<E> Unpin for EventEnvelopeBuilder<E>where
EventEnvelope<E>: Unpin,
impl<E> UnsafeUnpin for EventEnvelopeBuilder<E>where
EventEnvelope<E>: UnsafeUnpin,
impl<E> UnwindSafe for EventEnvelopeBuilder<E>where
EventEnvelope<E>: 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