Skip to main content

Budget

Trait Budget 

Source
pub trait Budget: Send + Sync {
    // Required method
    fn charge(&self, units: u64) -> bool;
}
Expand description

A CPU budget hook: work is charged in abstract units (roughly, bytes or objects processed), and the hook stops processing by returning false.

Required Methods§

Source

fn charge(&self, units: u64) -> bool

Charges units of work; returns whether processing may continue.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§