pub struct GenIndexAllocator<T> { /* private fields */ }Implementations§
Source§impl<T> GenIndexAllocator<T>
impl<T> GenIndexAllocator<T>
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn allocate(&mut self, value: T) -> Result<GenIndex, Error>
pub fn deallocate(&mut self, key: &GenIndex) -> Result<Option<T>, Error>
pub fn get(&self, key: &GenIndex) -> Option<&T>
pub fn get_mut(&mut self, key: &GenIndex) -> Option<&mut T>
pub fn set(&mut self, key: &GenIndex, value: T) -> Result<T, Error>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for GenIndexAllocator<T>
impl<T> RefUnwindSafe for GenIndexAllocator<T>where
T: RefUnwindSafe,
impl<T> Send for GenIndexAllocator<T>where
T: Send,
impl<T> Sync for GenIndexAllocator<T>where
T: Sync,
impl<T> Unpin for GenIndexAllocator<T>where
T: Unpin,
impl<T> UnwindSafe for GenIndexAllocator<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