[][src]Enum maxim::actors::Status

pub enum Status {
    Done,
    Skip,
    Reset,
    Stop,
}

Status of the message and potentially the actor as a resulting from processing a message with the actor.

Variants

Done

The message was processed and can be removed from the channel. Note that this doesn't necessarily mean that anything was done with the message, just that it can be removed. It is up to the actor to decide what, if anything, to do with the message.

Skip

The message was skipped and should remain in the channel. Once a message is skipped a skip cursor will be created in the actor's message channel which will act as the actual head of the channel until an Status::Reset is returned from an actor's processor. This enables an actor to skip messages while working on a process and then clear the skip cursor and resume normal processing. This functionality is critical for actors that implement a finite state machine.

Reset

Marks the message as processed and clears the skip cursor on the channel. A skip cursor is present when a message has been skipped by an actor returning Status::Skip from a call to the actor's message processor. If no skip cursor is set than this status is semantically the same as Status::Done.

Stop

Returned from an actor when the actor wants the system to stop the actor. When this status is returned the actor's Aid will no longer send any messages and the actor instance itself will be removed from the actors table in the ActorSystem. The user is advised to do any cleanup needed before returning Status::Stop.

Methods

impl Status[src]

pub fn done<T>(state: T) -> (T, Status)[src]

Ergonomic shortcut for writing (state, Status::Done)

pub fn skip<T>(state: T) -> (T, Status)[src]

Ergonomic shortcut for writing (state, Status::Skip)

pub fn reset<T>(state: T) -> (T, Status)[src]

Ergonomic shortcut for writing (state, Status::Reset)

pub fn stop<T>(state: T) -> (T, Status)[src]

Ergonomic shortcut for writing (state, Status::Stop)

Trait Implementations

impl Debug for Status[src]

impl<'de> Deserialize<'de> for Status[src]

impl Eq for Status[src]

impl PartialEq<Status> for Status[src]

impl Serialize for Status[src]

impl StructuralEq for Status[src]

impl StructuralPartialEq for Status[src]

Auto Trait Implementations

impl RefUnwindSafe for Status

impl Send for Status

impl Sync for Status

impl Unpin for Status

impl UnwindSafe for Status

Blanket Implementations

impl<T> ActorMessage for T where
    T: 'static + Serialize + DeserializeOwned + Sync + Send + Any + ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,