Meter

Trait Meter 

Source
pub trait Meter {
    // Required method
    fn fold(&self, f: &mut dyn FnMut() -> Result<Value>) -> Result<Value>;
}
Expand description

The host’s stopwatch.

beck-host may not read a clock — a wasm32-unknown-unknown build has none, and std::time::Instant::now() on that target is a panic rather than a number — so a host that wants to know what a fold cost passes one of these in. It is also the reason the fold is the only thing metered here: it is the one step whose cost is the program’s rather than the machine’s.

Required Methods§

Source

fn fold(&self, f: &mut dyn FnMut() -> Result<Value>) -> Result<Value>

Implementors§