pub trait Enter {
    type E;

    fn enter(&self) -> Self::E;
}
Expand description

Re-export this type so 3rd-party crates don’t need to depend on the aspect-rs crate. The Enter trait is called when entering in an aspect, before the wrapped expression is called.

Required Associated Types

The type returned by the enter function and carried to OnResult

Required Methods

enter is called when entering in an aspect

Use it to set-up some context before calling the expression. For instance, the ResponseTime metric in the metered crate uses it to get the current time before the invocation, and pass it over to OnResult to compute the elapsed time.

Aspects which don’t need enter can simply do nothing and return unit.

Implementors