Skip to main content

ResourceBudget

Trait ResourceBudget 

Source
pub trait ResourceBudget: Send + Sync {
    // Required methods
    fn allocation_limit(&self) -> usize;
    fn reserve(&self, bytes: usize) -> bool;
    fn work(&self, units: usize) -> bool;
    fn reject(&self);
}
Expand description

The requesting importer owns counters, limits, cancellation, and sticky errors.

Required Methods§

Source

fn allocation_limit(&self) -> usize

Source

fn reserve(&self, bytes: usize) -> bool

Source

fn work(&self, units: usize) -> bool

Source

fn reject(&self)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§