pub struct Capacity { /* private fields */ }
Expand description
The amount of strings and bytes that an interner can hold before reallocating
Implementations§
source§impl Capacity
impl Capacity
sourcepub fn new(strings: usize, bytes: NonZeroUsize) -> Self
pub fn new(strings: usize, bytes: NonZeroUsize) -> Self
Create a new Capacity
with the number of strings that the interner will hold
and the number of bytes that the interner will hold
sourcepub fn for_strings(strings: usize) -> Self
pub fn for_strings(strings: usize) -> Self
Create a new Capacity
with the number of strings that the interner will hold
sourcepub fn for_bytes(bytes: NonZeroUsize) -> Self
pub fn for_bytes(bytes: NonZeroUsize) -> Self
Create a new Capacity
with the number of bytes that the interner will hold
sourcepub fn minimal() -> Self
pub fn minimal() -> Self
Produces the smallest Capacity
with enough room for zero strings and a single byte
sourcepub fn bytes(&self) -> NonZeroUsize
pub fn bytes(&self) -> NonZeroUsize
Returns the number of bytes this capacity will allocate
Trait Implementations§
source§impl Ord for Capacity
impl Ord for Capacity
source§impl PartialEq<Capacity> for Capacity
impl PartialEq<Capacity> for Capacity
source§impl PartialOrd<Capacity> for Capacity
impl PartialOrd<Capacity> for Capacity
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Capacity
impl Eq for Capacity
impl StructuralEq for Capacity
impl StructuralPartialEq for Capacity
Auto Trait Implementations§
impl RefUnwindSafe for Capacity
impl Send for Capacity
impl Sync for Capacity
impl Unpin 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