pub struct EventSourcedHandle<C: Message, E: Send + Sync + 'static, S: Send + 'static> { /* private fields */ }Expand description
Spawned event-sourced behavior handle.
Implementations§
Source§impl<C, E, S> EventSourcedHandle<C, E, S>
impl<C, E, S> EventSourcedHandle<C, E, S>
Sourcepub fn actor_ref(&self) -> &ActorRef<EventSourcedMessage<C, S>>
pub fn actor_ref(&self) -> &ActorRef<EventSourcedMessage<C, S>>
Returns the behavior’s single ordered ingress actor ref.
ActorFlow::ask request builders should wrap domain commands with
EventSourcedMessage::command. Commands and state queries share this
mailbox, so same-sender enqueue order is FIFO.
Sourcepub fn tell(&self, command: C) -> PersistenceResult<()>
pub fn tell(&self, command: C) -> PersistenceResult<()>
Sends one command without waiting for persistence.
Sourcepub async fn state(&self) -> PersistenceResult<EventSourcedState<S>>
pub async fn state(&self) -> PersistenceResult<EventSourcedState<S>>
Observes current confirmed state through the behavior’s ordered mailbox.
Earlier messages have been handled before the reply. During persistence backoff, this remains responsive and does not wait for domain commands that were handled by moving them into the automatic backoff stash.
Sourcepub fn published_events(&self) -> Option<&Topic<PublishedEvent<E>>>
pub fn published_events(&self) -> Option<&Topic<PublishedEvent<E>>>
Returns the typed confirmed-event topic when publishing is enabled.
Trait Implementations§
Source§impl<C, E, S> Clone for EventSourcedHandle<C, E, S>
impl<C, E, S> Clone for EventSourcedHandle<C, E, S>
Auto Trait Implementations§
impl<C, E, S> Freeze for EventSourcedHandle<C, E, S>
impl<C, E, S> RefUnwindSafe for EventSourcedHandle<C, E, S>
impl<C, E, S> Send for EventSourcedHandle<C, E, S>
impl<C, E, S> Sync for EventSourcedHandle<C, E, S>
impl<C, E, S> Unpin for EventSourcedHandle<C, E, S>
impl<C, E, S> UnsafeUnpin for EventSourcedHandle<C, E, S>
impl<C, E, S> UnwindSafe for EventSourcedHandle<C, E, S>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<S> IntoEventHandlerResult<S> for S
impl<S> IntoEventHandlerResult<S> for S
Source§fn into_event_handler_result(self) -> Result<S, PersistenceError>
fn into_event_handler_result(self) -> Result<S, PersistenceError>
Converts this handler output into the runtime result.
Source§impl<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage