pub fn and_modify<F>(self, f: F) -> Self
    where
        F: FnOnce(&mut V),
    {
        match self {
            Entry::Occupied(mut entry) => {
                f(entry.get_mut());
                Entry::Occupied(entry)
            },
            Entry::Vacant(entry) => Entry::Vacant(entry),
        }
    }
/// Provides in-place mutable access to an occupied entry before any
/// potential inserts into the map.
///
/// # Examples
///
/// ```
/// # use slotmap::*;
/// let mut sm = SlotMap::new();
/// let mut sec = SparseSecondaryMap::new();
///
/// let k = sm.insert(1);
/// sec.insert(k, 0);
/// sec.entry(k).unwrap().and_modify(|x| *x = 1);
///
/// assert_eq!(sec[k], 1)
/// ```
Provides in-place mutable access to an occupied entry before any
potential inserts into the map.
Provides in - place mutable access to an occupied entry before any potential inserts into the map .
pub fn and_modify<F>(self, f: F) -> Self
    where
        F: FnOnce(&mut V),
    {
        match self {
            Entry::Occupied(mut entry) => {
                f(entry.get_mut());
                Entry::Occupied(entry)
            },
            Entry::Vacant(entry) => Entry::Vacant(entry),
        }
    }
pub fn and_modify < F > ( self , f : F ) -> Self where F : FnOnce ( & mut V ) , { match self { Entry :: Occupied ( mut entry ) => { f ( entry . get_mut ( ) ) ; Entry :: Occupied ( entry ) } , Entry :: Vacant ( entry ) => Entry :: Vacant ( entry ) , } }
Provides in-place mutable access to an occupied entry before any
potential inserts into the map.
Provides in - place mutable access to an occupied entry before any potential inserts into the map .
self
f
F
examples
None
use slotmap::*;
let mut sm = SlotMap::new();
let mut sec = SparseSecondaryMap::new().




let mut sm = SlotMap :: new () ; let mut sec = SparseSecondaryMap :: new () .