Struct auto_diff::collection::generational_index::GenIndex
source · [−]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
sourceimpl<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>ⓘNotable traits for GenIndexIter<'a, T>impl<'a, T> Iterator for GenIndexIter<'a, T> type Item = GenKey;
Trait Implementations
sourceimpl<'de, T> Deserialize<'de> for GenIndex<T> where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for GenIndex<T> where
T: Deserialize<'de>,
sourcefn 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> 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more