Skip to main content

Hook

Trait Hook 

Source
pub trait Hook {
    // Required methods
    fn sites(&mut self, block: &BlockView<'_>) -> Vec<Site>;
    fn instrument(&mut self, site: &Site, emit: &mut Emitter<'_>);
}
Expand description

A rewrite of lifted code at chosen sites. See the module docs.

Required Methods§

Source

fn sites(&mut self, block: &BlockView<'_>) -> Vec<Site>

The sites in block to instrument. Returned in block order; a hook that instruments none returns an empty list.

Source

fn instrument(&mut self, site: &Site, emit: &mut Emitter<'_>)

Emits the hook’s code at site.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§