[−][src]Enum maxim::actors::Status
Status of the message and potentially the actor as a resulting from processing a message with the actor.
Variants
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.
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.
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
.
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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Status
[src]
impl PartialEq<Status> for Status
[src]
impl Serialize for Status
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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]
T: 'static + Serialize + DeserializeOwned + Sync + Send + Any + ?Sized,
fn to_bincode(&Self) -> Result<Vec<u8>, Box<dyn Error + 'static>>
[src]
fn from_bincode(&Vec<u8>) -> Result<T, Box<dyn Error + 'static>>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,