pub struct ResolvedMap<K, V>where
K: IsEnabled,{
map: IntMap<K, V>,
default: V,
}Expand description
A keyed lookup where an empty map returns the neutral default for every key, but a populated map is authoritative (present -> Some, absent -> None).
Fields§
§map: IntMap<K, V>§default: VImplementations§
Source§impl<K, V> ResolvedMap<K, V>
impl<K, V> ResolvedMap<K, V>
Sourcepub fn new(default: V) -> Self
pub fn new(default: V) -> Self
Create an empty map (introspection mode) with the neutral value returned for every key.
Sourcepub fn default_value(&self) -> &V
pub fn default_value(&self) -> &V
The neutral default value handed back for every key while the map is empty.
Trait Implementations§
Source§impl<K, V: Clone> Clone for ResolvedMap<K, V>
impl<K, V: Clone> Clone for ResolvedMap<K, V>
Source§fn clone(&self) -> ResolvedMap<K, V>
fn clone(&self) -> ResolvedMap<K, V>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<K, V> Freeze for ResolvedMap<K, V>where
V: Freeze,
impl<K, V> RefUnwindSafe for ResolvedMap<K, V>where
V: RefUnwindSafe,
K: RefUnwindSafe,
impl<K, V> Send for ResolvedMap<K, V>
impl<K, V> Sync for ResolvedMap<K, V>
impl<K, V> Unpin for ResolvedMap<K, V>
impl<K, V> UnsafeUnpin for ResolvedMap<K, V>where
V: UnsafeUnpin,
impl<K, V> UnwindSafe for ResolvedMap<K, V>where
V: UnwindSafe,
K: 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