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]),
}Expand description
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.