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
sourceimpl Action
impl Action
sourcepub fn outcome(self, outcome: Outcome)
pub fn outcome(self, outcome: Outcome)
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
Auto Trait Implementations
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnwindSafe for Action
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more