Struct termite::SparseArray
source · #[repr(transparent)]pub struct SparseArray<T> { /* private fields */ }
Implementations
sourceimpl<T> SparseArray<T>
impl<T> SparseArray<T>
pub const fn new() -> Self
pub fn contains(&self, index: usize) -> bool
pub fn get(&self, index: usize) -> Option<&T>
pub fn get_mut(&mut self, index: usize) -> Option<&mut T>
pub unsafe fn get_unchecked(&self, index: usize) -> &T
pub unsafe fn get_unchecked_mut(&mut self, index: usize) -> &mut T
pub fn insert(&mut self, index: usize, value: T)
pub fn remove(&mut self, index: usize) -> Option<T>
pub unsafe fn remove_unchecked(&mut self, index: usize) -> T
pub fn iter(&self) -> impl Iterator<Item = (usize, &T)>
pub fn iter_mut(&mut self) -> impl Iterator<Item = (usize, &mut T)>
pub fn clear(&mut self)
Trait Implementations
sourceimpl<T: Clone> Clone for SparseArray<T>
impl<T: Clone> Clone for SparseArray<T>
sourcefn clone(&self) -> SparseArray<T>
fn clone(&self) -> SparseArray<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<T: Debug> Debug for SparseArray<T>
impl<T: Debug> Debug for SparseArray<T>
sourceimpl<T> Default for SparseArray<T>
impl<T> Default for SparseArray<T>
sourceimpl<T: Hash> Hash for SparseArray<T>
impl<T: Hash> Hash for SparseArray<T>
sourceimpl<T: PartialEq> PartialEq<SparseArray<T>> for SparseArray<T>
impl<T: PartialEq> PartialEq<SparseArray<T>> for SparseArray<T>
sourcefn eq(&self, other: &SparseArray<T>) -> bool
fn eq(&self, other: &SparseArray<T>) -> bool
impl<T: Eq> Eq for SparseArray<T>
impl<T> StructuralEq for SparseArray<T>
impl<T> StructuralPartialEq for SparseArray<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for SparseArray<T>where
T: RefUnwindSafe,
impl<T> Send for SparseArray<T>where
T: Send,
impl<T> Sync for SparseArray<T>where
T: Sync,
impl<T> Unpin for SparseArray<T>where
T: Unpin,
impl<T> UnwindSafe for SparseArray<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for Twhere
T: Hash + ?Sized,
impl<T> CallHasher for Twhere
T: Hash + ?Sized,
sourceimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read moresourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more