Struct flo_sparse_array::SparseArray
source · pub struct SparseArray<TTarget> { /* private fields */ }
Expand description
Sparse array indexed by usize, implemented using the Cuckoo hash algorithm
Implementations§
source§impl<TTarget> SparseArray<TTarget>
impl<TTarget> SparseArray<TTarget>
sourcepub fn empty() -> SparseArray<TTarget>
pub fn empty() -> SparseArray<TTarget>
Creates an empty sparse array
sourcepub fn get(&self, pos: usize) -> Option<&TTarget>
pub fn get(&self, pos: usize) -> Option<&TTarget>
Retrieves the value at the specified location, if it exists
sourcepub fn get_mut(&mut self, pos: usize) -> Option<&mut TTarget>
pub fn get_mut(&mut self, pos: usize) -> Option<&mut TTarget>
Retrieves the value at the specified location, if it exists
sourcepub fn remove(&mut self, pos: usize) -> Option<TTarget>
pub fn remove(&mut self, pos: usize) -> Option<TTarget>
Removes a value from this array, if it exists
pub fn check_hash_values(&self)
sourcepub fn iter<'a>(&'a self) -> impl 'a + Iterator<Item = (usize, &'a TTarget)>
pub fn iter<'a>(&'a self) -> impl 'a + Iterator<Item = (usize, &'a TTarget)>
Creates an iterator that covers the values in this sparse array
sourcepub fn iter_mut<'a>(
&'a mut self
) -> impl 'a + Iterator<Item = (usize, &'a mut TTarget)>
pub fn iter_mut<'a>( &'a mut self ) -> impl 'a + Iterator<Item = (usize, &'a mut TTarget)>
Creates an iterator that covers the values in this sparse array
Trait Implementations§
Auto Trait Implementations§
impl<TTarget> RefUnwindSafe for SparseArray<TTarget>where TTarget: RefUnwindSafe,
impl<TTarget> Send for SparseArray<TTarget>where TTarget: Send,
impl<TTarget> Sync for SparseArray<TTarget>where TTarget: Sync,
impl<TTarget> Unpin for SparseArray<TTarget>where TTarget: Unpin,
impl<TTarget> UnwindSafe for SparseArray<TTarget>where TTarget: 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