pub struct EventBuilder { /* private fields */ }Expand description
Builder for events. Used by the verb dispatch path.
Implementations§
Source§impl EventBuilder
impl EventBuilder
Sourcepub fn new(
verb: impl Into<String>,
substrate: SubstrateKind,
actor: impl Into<String>,
) -> Self
pub fn new( verb: impl Into<String>, substrate: SubstrateKind, actor: impl Into<String>, ) -> Self
Create a new builder for an event produced by verb acting on substrate as actor.
Sourcepub fn payload(self, payload: EventPayload) -> Self
pub fn payload(self, payload: EventPayload) -> Self
Set the typed payload for this event.
Sourcepub fn payload_schema_version(self, version: u32) -> Self
pub fn payload_schema_version(self, version: u32) -> Self
Set the payload schema version (defaults to 1).
Sourcepub fn profile_state_version(self, version: u64) -> Self
pub fn profile_state_version(self, version: u64) -> Self
Record the brain profile state version observed at emit time.
Sourcepub fn aggregate(self, aggregate: AggregateRef) -> Self
pub fn aggregate(self, aggregate: AggregateRef) -> Self
Thread this event into an aggregate chain.
Auto Trait Implementations§
impl Freeze for EventBuilder
impl RefUnwindSafe for EventBuilder
impl Send for EventBuilder
impl Sync for EventBuilder
impl Unpin for EventBuilder
impl UnsafeUnpin for EventBuilder
impl UnwindSafe for EventBuilder
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