Struct sparse_array::SparseArray
source · pub struct SparseArray<V> {
index: BitmapIndex,
data: Box<[V]>,
}
Fields§
§index: BitmapIndex
§data: Box<[V]>
Implementations§
source§impl<V> SparseArray<V>
impl<V> SparseArray<V>
pub fn new() -> Self
pub fn get(&self, idx: u8) -> Option<&V>
pub fn set(self, idx: u8, value: V) -> Self
pub fn remove(self, idx: u8) -> (Self, Option<V>)
pub fn is_empty(&self) -> bool
pub fn contains_key(&self, idx: u8) -> bool
pub fn iter(&self) -> SparseArrayIter<'_, V> ⓘ
Trait Implementations§
source§impl<V: Clone> Clone for SparseArray<V>
impl<V: Clone> Clone for SparseArray<V>
source§fn clone(&self) -> SparseArray<V>
fn clone(&self) -> SparseArray<V>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<V: Debug> Debug for SparseArray<V>
impl<V: Debug> Debug for SparseArray<V>
source§impl<V> Default for SparseArray<V>
impl<V> Default for SparseArray<V>
source§impl<V: PartialEq> PartialEq<SparseArray<V>> for SparseArray<V>
impl<V: PartialEq> PartialEq<SparseArray<V>> for SparseArray<V>
source§fn eq(&self, other: &SparseArray<V>) -> bool
fn eq(&self, other: &SparseArray<V>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<V: Eq> Eq for SparseArray<V>
impl<V> StructuralEq for SparseArray<V>
impl<V> StructuralPartialEq for SparseArray<V>
Auto Trait Implementations§
impl<V> RefUnwindSafe for SparseArray<V>where V: RefUnwindSafe,
impl<V> Send for SparseArray<V>where V: Send,
impl<V> Sync for SparseArray<V>where V: Sync,
impl<V> Unpin for SparseArray<V>
impl<V> UnwindSafe for SparseArray<V>where V: 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