pub struct ByteBudget { /* private fields */ }Expand description
A shared cap on memory-resident bytes.
Cloned via Arc into every filesystem that should draw from the same
pool. Exceeding the limit fails the write loudly, ENOSPC-style — an
in-band error a model reads and adapts to; fail loud over quietly eating
RAM.
Implementations§
Source§impl ByteBudget
impl ByteBudget
Sourcepub fn new(limit: u64) -> ByteBudget
pub fn new(limit: u64) -> ByteBudget
A budget of limit bytes labeled “memory” in error messages.
Sourcepub fn labeled(limit: u64, label: impl Into<String>) -> ByteBudget
pub fn labeled(limit: u64, label: impl Into<String>) -> ByteBudget
A budget whose errors name label (e.g. a config knob like
vfs-budget), so the failure tells the reader what to raise.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ByteBudget
impl RefUnwindSafe for ByteBudget
impl Send for ByteBudget
impl Sync for ByteBudget
impl Unpin for ByteBudget
impl UnsafeUnpin for ByteBudget
impl UnwindSafe for ByteBudget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more