pub struct Capacity<Tag> { /* private fields */ }
Expand description
A number that overestimates the guaranteed size of a number of slices.
This is the counter part of Prefix
. It encapsulates a field that is guaranteed to be at least
the size of all indices with the exact same tag. In other words, all slices at least as long
as this number are safe to be accessed by indices.
Implementations§
source§impl<T: Tag> Capacity<T>
impl<T: Tag> Capacity<T>
sourcepub fn with_tag<NewT>(self, less: TagLessEq<NewT, T>) -> Capacity<NewT>
pub fn with_tag<NewT>(self, less: TagLessEq<NewT, T>) -> Capacity<NewT>
Interpret this with the tag of a set of potentially shorter slices.
The proof of inequality was performed in any of the possible constructors that allow the
instance of TagLessEq
to exist in the first place.
sourcepub fn saturating_add(self, add: usize) -> Self
pub fn saturating_add(self, add: usize) -> Self
Create a larger capacity.
Trait Implementations§
Auto Trait Implementations§
impl<Tag> RefUnwindSafe for Capacity<Tag>where
Tag: RefUnwindSafe,
impl<Tag> Send for Capacity<Tag>where
Tag: Send,
impl<Tag> Sync for Capacity<Tag>where
Tag: Sync,
impl<Tag> Unpin for Capacity<Tag>where
Tag: Unpin,
impl<Tag> UnwindSafe for Capacity<Tag>where
Tag: UnwindSafe,
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