Struct prefix_trie::map::VacantEntry
source · pub struct VacantEntry<'a, P, T> { /* private fields */ }Expand description
A mutable view into a missing entry. The information within this structure describes a path towards that missing node, and how to insert it.
Implementations§
source§impl<'a, P, T> VacantEntry<'a, P, T>
impl<'a, P, T> VacantEntry<'a, P, T>
source§impl<'a, P, T> VacantEntry<'a, P, T>where
P: Prefix,
impl<'a, P, T> VacantEntry<'a, P, T>where
P: Prefix,
sourcepub fn insert(self, default: T) -> &'a mut T
pub fn insert(self, default: T) -> &'a mut T
Get a mutable reference to the value. If the value is yet empty, set it to the given default value.
sourcepub fn insert_with<F: FnOnce() -> T>(self, default: F) -> &'a mut T
pub fn insert_with<F: FnOnce() -> T>(self, default: F) -> &'a mut T
Get a mutable reference to the value. If the value is yet empty, set it to the return value from the given function.