pub struct GenIndex<T> { /* private fields */ }
Expand description
A simple generational index implementation. The data is stored in a read-only manner, Use RefCell to get mutability. Not secure, no index validity check.
Implementations§
Source§impl<T> GenIndex<T>
impl<T> GenIndex<T>
pub fn is_empty(&self) -> bool
Sourcepub fn remove(&mut self, index: &GenKey) -> Result<(), AutoDiffError>
pub fn remove(&mut self, index: &GenKey) -> Result<(), AutoDiffError>
Remove an item from the list.
Sourcepub fn replace(&mut self, index: &GenKey, val: T) -> Result<(), AutoDiffError>
pub fn replace(&mut self, index: &GenKey, val: T) -> Result<(), AutoDiffError>
Replace the item of the index with a new one.
pub fn iter_key(&self) -> GenIndexIter<'_, T> ⓘ
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for GenIndex<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for GenIndex<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<T: Eq> Eq for GenIndex<T>
Auto Trait Implementations§
impl<T> Freeze for GenIndex<T>
impl<T> RefUnwindSafe for GenIndex<T>where
T: RefUnwindSafe,
impl<T> Send for GenIndex<T>where
T: Send,
impl<T> Sync for GenIndex<T>where
T: Sync,
impl<T> Unpin for GenIndex<T>where
T: Unpin,
impl<T> UnwindSafe for GenIndex<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