pub struct FreeList<T, M> {
slots: Vec<Slot<T>>,
free_list_head: Option<u32>,
active_count: usize,
_marker: PhantomData<M>,
}
Fields§
§slots: Vec<Slot<T>>
§free_list_head: Option<u32>
§active_count: usize
§_marker: PhantomData<M>
Implementations§
source§impl<T, M> FreeList<T, M>
impl<T, M> FreeList<T, M>
pub fn clear(&mut self)
pub fn get(&self, id: &FreeListHandle<M>) -> &T
pub fn get_mut(&mut self, id: &FreeListHandle<M>) -> &mut T
pub fn get_opt(&self, id: &WeakFreeListHandle<M>) -> Option<&T>
pub fn get_opt_mut(&mut self, id: &WeakFreeListHandle<M>) -> Option<&mut T>
pub fn insert(&mut self, item: T) -> FreeListHandle<M>
pub fn free(&mut self, id: FreeListHandle<M>) -> T
pub fn len(&self) -> usize
Trait Implementations§
source§impl<T, M> MallocSizeOf for FreeList<T, M>where
T: MallocSizeOf,
M: MallocSizeOf,
impl<T, M> MallocSizeOf for FreeList<T, M>where
T: MallocSizeOf,
M: MallocSizeOf,
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Auto Trait Implementations§
impl<T, M> Freeze for FreeList<T, M>
impl<T, M> RefUnwindSafe for FreeList<T, M>where
M: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, M> Send for FreeList<T, M>
impl<T, M> Sync for FreeList<T, M>
impl<T, M> Unpin for FreeList<T, M>
impl<T, M> UnwindSafe for FreeList<T, M>where
M: UnwindSafe,
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more