Crate cvlr_hook

Crate cvlr_hook 

Source

Attribute Macros§

cvlr_hook_on_entry
This macro is used to insert a hook at the start of a function.Example#[cvlr_hook_on_entry(hook())] fn t1() { // hook inserted here println!(“t1”); }expands tofn t1() { hook(); println!(“t1”); }
cvlr_hook_on_exit
This macro is used to insert a hook at the end of a function.If the function returns a value, the hook is inserted before the return statement.Example#[cvlr_hook_on_exit(hook())] fn t1() { assert_eq!(1, 1); assert_eq!(2, 2); // hook inserted here }expands tofn t1() { assert_eq!(1, 1); assert_eq!(2, 2); hook() }