Enum total_space::Action[][src]

pub enum Action<State: KeyLike, Payload: DataLike> {
    Defer,
    Ignore,
    Change(State),
    Send1(Emit<Payload>),
    ChangeAndSend1(State, Emit<Payload>),
    Sends([Option<Emit<Payload>>; 6]),
    ChangeAndSends(State, [Option<Emit<Payload>>; 6]),
}

Specify an action the agent may take when handling an event.

Variants

Defer

Defer the event, keep the state the same, do not send any messages.

This is only useful if it is needed to be listed as an alternative with other actions; Otherwise, use the Reaction.Defer value.

This is only allowed if the agent’s state_is_deferring, waiting for specific message(s) to resume normal operations.

Ignore

Consume (ignore) the event, keep the state the same, do not send any messages.

This is only useful if it is needed to be listed as an alternative with other actions; Otherwise, use the Reaction.Ignore value.

Change(State)

Consume (handle) the event, change the agent state, do not send any messages.

Send1(Emit<Payload>)

Consume (handle) the event, keep the state the same, send a single message.

ChangeAndSend1(State, Emit<Payload>)

Consume (handle) the event, change the agent state, send a single message.

Sends([Option<Emit<Payload>>; 6])

Consume (handle) the event, keep the state the same, send multiple messages.

ChangeAndSends(State, [Option<Emit<Payload>>; 6])

Consume (handle) the event, change the agent state, send multiple messages.

Trait Implementations

impl<State: Clone + KeyLike, Payload: Clone + DataLike> Clone for Action<State, Payload>[src]

impl<State: Copy + KeyLike, Payload: Copy + DataLike> Copy for Action<State, Payload>[src]

impl<State: Debug + KeyLike, Payload: Debug + DataLike> Debug for Action<State, Payload>[src]

impl<State: Eq + KeyLike, Payload: Eq + DataLike> Eq for Action<State, Payload>[src]

impl<State: PartialEq + KeyLike, Payload: PartialEq + DataLike> PartialEq<Action<State, Payload>> for Action<State, Payload>[src]

impl<State: KeyLike, Payload: DataLike> StructuralEq for Action<State, Payload>[src]

impl<State: KeyLike, Payload: DataLike> StructuralPartialEq for Action<State, Payload>[src]

Auto Trait Implementations

impl<State, Payload> RefUnwindSafe for Action<State, Payload> where
    Payload: RefUnwindSafe,
    State: RefUnwindSafe

impl<State, Payload> Send for Action<State, Payload> where
    Payload: Send,
    State: Send

impl<State, Payload> Sync for Action<State, Payload> where
    Payload: Sync,
    State: Sync

impl<State, Payload> Unpin for Action<State, Payload> where
    Payload: Unpin,
    State: Unpin

impl<State, Payload> UnwindSafe for Action<State, Payload> where
    Payload: UnwindSafe,
    State: UnwindSafe

Blanket Implementations

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> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.