pub struct Slab<T, Tag: Tag> { /* private fields */ }Implementations§
Source§impl<T, Tag: Tag> Slab<T, Tag>
impl<T, Tag: Tag> Slab<T, Tag>
Sourcepub fn try_new(cap: Capacity) -> Result<Self, Error>
pub fn try_new(cap: Capacity) -> Result<Self, Error>
Reserves the complete typed target table transactionally.
Sourcepub fn capacity(&self) -> Capacity
pub fn capacity(&self) -> Capacity
Returns the immutable extent admitted when this route table was allocated.
pub fn len(&self) -> Count
Sourcepub fn available(&self) -> Count
pub fn available(&self) -> Count
Returns capacity minus the number of initialized values.
Forgotten reservations are included, so this is an upper bound on
reservable slots. Reservation still reports Full or IdentityExhausted.
pub fn is_empty(&self) -> bool
pub fn next_generation(&self) -> Option<Epoch>
pub fn get(&self, parts: Parts<Tag>) -> Option<&T>
pub fn contains(&self, parts: Parts<Tag>) -> bool
pub fn key_at(&self, slot: SlotIndex) -> Option<Key<Tag>>
pub fn access(&mut self) -> Access<'_, T, Tag>
Auto Trait Implementations§
impl<T, Tag> !Freeze for Slab<T, Tag>
impl<T, Tag> !RefUnwindSafe for Slab<T, Tag>
impl<T, Tag> !Send for Slab<T, Tag>
impl<T, Tag> !Sync for Slab<T, Tag>
impl<T, Tag> !UnwindSafe for Slab<T, Tag>
impl<T, Tag> Forget for Slab<T, Tag>
impl<T, Tag> Unpin for Slab<T, Tag>
impl<T, Tag> UnsafeUnpin for Slab<T, Tag>
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