[][src]Attribute Macro call_trace_macro::trace_with

#[trace_with]

The #[trace_with] macro. Needs to be applied to function definitions, and will invoke hte Trace interface on the user-provided expression.

Example

use call_trace::{trace_with, CallContext, Trace};

impl MyType {
    #[trace_with(self)]
    fn foo(&mut self) {
        // ...
    }
}
impl Trace for MyType {
    fn on_pre(&mut self, ctx: &CallContext) {
        // ...
    }
    fn on_post(&mut self, ctx: &CallContext) {
        // ...
    }
}