pub trait OnResult<R>: Enter {
fn on_result(&self, enter: Self::E, _result: &R) -> Advice { ... }
fn leave_scope(&self, _enter: Self::E) -> Advice { ... }
}
Expand description
Re-export aspect-rs
’s types to avoid crates depending on it.
The OnResult
trait is implemented on Aspects to get notified when an expression has returned.
Provided Methods
Called when an expression has returned.
This function is passed both the enter return value, and the expression return value.
on_result
does not get a chance to alter the returned result. Use OnResultMut
for that purpose.
fn leave_scope(&self, _enter: Self::E) -> Advice
fn leave_scope(&self, _enter: Self::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
.