pub struct Slab<T> { /* private fields */ }Implementations§
Source§impl<T> Slab<T>
impl<T> Slab<T>
pub fn new() -> Slab<T>
pub fn mem_size(&self) -> usize
pub fn with_capacity(capacity: usize) -> Slab<T>
pub fn capacity(&self) -> usize
pub fn reserve(&mut self, additional: usize)
pub fn reserve_exact(&mut self, additional: usize)
pub fn shrink_to_fit(&mut self)
pub fn clear(&mut self)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> SlabIter<'_, T> ⓘ
pub fn iter_mut(&mut self) -> SlabIterMut<'_, T> ⓘ
pub fn get(&self, key: usize) -> Option<&T>
pub fn get_mut(&mut self, key: usize) -> Option<&mut T>
pub unsafe fn get_unchecked(&self, key: usize) -> &T
pub unsafe fn get_unchecked_mut(&mut self, key: usize) -> &mut T
pub fn alloc_with_is_first(&mut self) -> (usize, &mut T, bool)
pub fn alloc_with_is_first_at(&mut self, key: usize) -> (&mut T, bool)
pub fn alloc(&mut self) -> (usize, &mut T)
pub fn alloc_at(&mut self, key: usize) -> &mut T
pub fn insert(&mut self, val: T) -> usize
pub fn insert_at(&mut self, key: usize, val: T)
pub fn remove(&mut self, key: usize) -> T
pub unsafe fn replace(&mut self, key: usize, value: T) -> T
pub fn contains(&self, key: usize) -> bool
Trait Implementations§
Source§impl<T> IndexMap<T> for Slab<T>
impl<T> IndexMap<T> for Slab<T>
fn len(&self) -> usize
fn get(&self, key: usize) -> Option<&T>
fn get_mut(&mut self, key: usize) -> Option<&mut T>
fn contains(&self, key: usize) -> bool
unsafe fn get_unchecked(&self, key: usize) -> &T
unsafe fn get_unchecked_mut(&mut self, key: usize) -> &mut T
fn insert(&mut self, val: T) -> usize
fn remove(&mut self, key: usize) -> T
Source§impl<'a, T> IntoIterator for &'a Slab<T>
impl<'a, T> IntoIterator for &'a Slab<T>
Source§impl<'a, T> IntoIterator for &'a mut Slab<T>
impl<'a, T> IntoIterator for &'a mut Slab<T>
Auto Trait Implementations§
impl<T> Freeze for Slab<T>
impl<T> RefUnwindSafe for Slab<T>where
T: RefUnwindSafe,
impl<T> Send for Slab<T>where
T: Send,
impl<T> Sync for Slab<T>where
T: Sync,
impl<T> Unpin for Slab<T>where
T: Unpin,
impl<T> UnwindSafe for Slab<T>where
T: 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