pub struct EventBuilder<P> {
parent: Option<EventId>,
lane: u32,
correlation_id: Option<EventId>,
payload: P,
flags: EventFlags,
}Expand description
Builder for creating events with proper positioning.
Fields§
§parent: Option<EventId>§lane: u32§correlation_id: Option<EventId>§payload: P§flags: EventFlagsImplementations§
Source§impl<P> EventBuilder<P>
impl<P> EventBuilder<P>
Sourcepub fn correlation(self, correlation_id: EventId) -> Self
pub fn correlation(self, correlation_id: EventId) -> Self
Set the correlation ID.
Sourcepub fn requires_ack(self) -> Self
pub fn requires_ack(self) -> Self
Mark this event as requiring acknowledgment.
Sourcepub fn transactional(self) -> Self
pub fn transactional(self) -> Self
Mark this event as transactional.
Sourcepub fn get_parent(&self) -> Option<EventId>
pub fn get_parent(&self) -> Option<EventId>
Get the configured parent.
Sourcepub fn get_flags(&self) -> EventFlags
pub fn get_flags(&self) -> EventFlags
Get the configured flags.
Sourcepub fn get_correlation_id(&self) -> Option<EventId>
pub fn get_correlation_id(&self) -> Option<EventId>
Get the correlation ID (or None).
Sourcepub fn into_payload(self) -> P
pub fn into_payload(self) -> P
Consume the builder and return the payload.
Trait Implementations§
Source§impl<P: Clone> Clone for EventBuilder<P>
impl<P: Clone> Clone for EventBuilder<P>
Source§fn clone(&self) -> EventBuilder<P>
fn clone(&self) -> EventBuilder<P>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<P> Freeze for EventBuilder<P>where
P: Freeze,
impl<P> RefUnwindSafe for EventBuilder<P>where
P: RefUnwindSafe,
impl<P> Send for EventBuilder<P>where
P: Send,
impl<P> Sync for EventBuilder<P>where
P: Sync,
impl<P> Unpin for EventBuilder<P>where
P: Unpin,
impl<P> UnwindSafe for EventBuilder<P>where
P: 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