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”);
}
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()
}