logo
pub struct Action {
    pub events: Arc<[Event]>,
    /* private fields */
}
Expand description

The environment given to the action handler.

This deliberately does not implement Clone to make it hard to move it out of the handler, which you should not do.

The Action::outcome() method is the only way to set the outcome of the action, and it must be called before the handler returns.

Fields

events: Arc<[Event]>

The collected events which triggered the action.

Implementations

Set the action’s outcome.

This takes self and Action is not Clone, so it’s only possible to call it once. Regardless, if you do manage to call it twice, it will do nothing beyond the first call.

See the Action documentation about handlers to learn why it’s a bad idea to clone or send it elsewhere, and what kind of handlers you cannot use.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more