pub struct Capacity { /* private fields */ }Expand description
A store’s size cap.
Implementations§
Source§impl Capacity
impl Capacity
Sourcepub const fn new(cap_bytes: u64) -> Self
pub const fn new(cap_bytes: u64) -> Self
A hard cap of cap_bytes (the engine limit: natively applied as
max_page_count, on a Durable Object its fixed 10 GB) with the
default reserve, max(reserve_floor(4096), cap_bytes / 64).
Sourcepub const fn with_reserve(self, reserve_bytes: u64) -> Self
pub const fn with_reserve(self, reserve_bytes: u64) -> Self
Keep reserve_bytes free instead of the default. Below
reserve_floor a delete may fail at the engine limit.
Sourcepub const fn reserve_bytes(&self) -> u64
pub const fn reserve_bytes(&self) -> u64
The reserve kept free below the hard cap.
Sourcepub const fn soft_limit(&self) -> u64
pub const fn soft_limit(&self) -> u64
Where batches with a put start returning Full: cap - reserve.
Trait Implementations§
impl Copy for Capacity
impl Eq for Capacity
impl StructuralPartialEq for Capacity
Auto Trait Implementations§
impl Freeze for Capacity
impl RefUnwindSafe for Capacity
impl Send for Capacity
impl Sync for Capacity
impl Unpin for Capacity
impl UnsafeUnpin for Capacity
impl UnwindSafe for Capacity
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