[−][src]Struct simple_slab::Slab
Implementations
impl<T> Slab<T>
[src]
pub fn new() -> Slab<T>
[src]
Creates a new Slab
pub fn with_capacity(capacity: usize) -> Slab<T>
[src]
pub fn insert(&mut self, elem: T)
[src]
Inserts a new element into the slab, re-allocating if neccessary.
Panics
- If the host system is out of memory.
pub fn remove(&mut self, offset: usize) -> T
[src]
pub fn len(&self) -> usize
[src]
Returns the number of elements in the slab
pub fn iter(&self) -> SlabIter<'_, T>ⓘ
[src]
Returns an iterator over the slab
pub fn iter_mut(&mut self) -> SlabMutIter<'_, T>ⓘNotable traits for SlabMutIter<'a, T>
impl<'a, T> Iterator for SlabMutIter<'a, T> type Item = &'a mut T;
[src]
Notable traits for SlabMutIter<'a, T>
impl<'a, T> Iterator for SlabMutIter<'a, T> type Item = &'a mut T;
Returns a mutable iterator over the slab
Trait Implementations
impl<T> Drop for Slab<T>
[src]
impl<T> Index<usize> for Slab<T>
[src]
type Output = T
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output
[src]
impl<'a, T> IntoIterator for &'a Slab<T>
[src]
type Item = &'a T
The type of the elements being iterated over.
type IntoIter = SlabIter<'a, T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> SlabIter<'a, T>ⓘ
[src]
impl<'a, T> IntoIterator for &'a mut Slab<T>
[src]
type Item = &'a mut T
The type of the elements being iterated over.
type IntoIter = SlabMutIter<'a, T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> SlabMutIter<'a, T>ⓘNotable traits for SlabMutIter<'a, T>
impl<'a, T> Iterator for SlabMutIter<'a, T> type Item = &'a mut T;
[src]
Notable traits for SlabMutIter<'a, T>
impl<'a, T> Iterator for SlabMutIter<'a, T> type Item = &'a mut T;
Auto Trait Implementations
impl<T> RefUnwindSafe for Slab<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> !Send for Slab<T>
impl<T> !Sync for Slab<T>
impl<T> Unpin for Slab<T>
impl<T> UnwindSafe for Slab<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,