OnResultMut

Trait OnResultMut 

Source
pub trait OnResultMut<R>: Enter {
    // Provided methods
    fn on_result(&self, enter: <Self as Enter>::E, _result: &mut R) -> Advice { ... }
    fn leave_scope(&self, _enter: <Self as Enter>::E) -> Advice { ... }
}
Expand description

The OnResult trait is implemented on Aspects to get notified when an expression has returned, and provide the possibility to alter the result.

Provided Methods§

Source

fn on_result(&self, enter: <Self as Enter>::E, _result: &mut R) -> Advice

Called when an expression has returned.

This function is passed both the enter return value, and the expression return value.

Source

fn leave_scope(&self, _enter: <Self as Enter>::E) -> Advice

Called when an expression has exited, but the return value isn’t known. This can happen because of a panic, or if control flow bypasses a macro. This is also called by the default implementation of on_result.

Implementors§

Source§

impl<R, A: OnResult<R>> OnResultMut<R> for A