Trait aspect::Enter[][src]

pub trait Enter {
    type E;
    fn enter(&self) -> Self::E;
}

The Enter trait is called when entering in an aspect, before the wrapped expression is called.

Associated Types

type E[src]

The type returned by the enter function and carried to OnResult

Loading content...

Required methods

fn enter(&self) -> Self::E[src]

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.

Loading content...

Implementors

Loading content...