[][src]Attribute Macro call_trace_macro::inject_with


The #[inject_with] macro. Needs to be applied to function definitions, and will call a user-provided expression with the function body wrapped in a closure.

The attribute accepts additional expression arguments that will be passed to the user-provided function as extra arguments.


use call_trace::inject_with;

impl MyType {
    fn foo(&mut self) {
        // ...

    fn trace<T, F: FnOnce() -> T>(&mut self) -> impl FnOnce(F) -> T {
        |f| {