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 more