pub struct RememberingUniqueMap<K: TName + Ord, V> { /* private fields */ }
Expand description
wrapper around UniqueMap
that remembers which values were asked for in get
Implementations§
source§impl<K: TName, V> RememberingUniqueMap<K, V>
impl<K: TName, V> RememberingUniqueMap<K, V>
pub fn new() -> Self
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn add(&mut self, key: K, value: V) -> Result<(), (K, K::Loc)>
pub fn key_gotten(&self, key: &K) -> bool
pub fn contains_key(&self, key: &K) -> bool
pub fn contains_key_(&self, key_: &K::Key) -> bool
pub fn get(&mut self, key: &K) -> Option<&V>
pub fn get_mut(&mut self, key: &K) -> Option<&mut V>
pub fn get_loc(&mut self, key: &K) -> Option<&K::Loc>
pub fn remove(&mut self, key: &K) -> Option<V>
pub fn map<V2, F>(self, f: F) -> RememberingUniqueMap<K, V2>where F: FnMut(K, V) -> V2,
pub fn ref_map<V2, F>(&self, f: F) -> RememberingUniqueMap<K, V2>where F: FnMut(K, &V) -> V2,
pub fn union_with<F>(&self, other: &Self, f: F) -> Selfwhere V: Clone, F: FnMut(&K, &V, &V) -> V,
pub fn iter(&self) -> Iter<'_, K, V> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_, K, V> ⓘ
pub fn maybe_from_opt_iter( iter: impl Iterator<Item = Option<(K, V)>> ) -> Option<Result<RememberingUniqueMap<K, V>, (K::Key, K::Loc, K::Loc)>>
pub fn maybe_from_iter( iter: impl Iterator<Item = (K, V)> ) -> Result<RememberingUniqueMap<K, V>, (K::Key, K::Loc, K::Loc)>
pub fn into_inner(self) -> UniqueMap<K, V>
pub fn remember(self) -> BTreeSet<K>
Trait Implementations§
source§impl<K: Clone + TName + Ord, V: Clone> Clone for RememberingUniqueMap<K, V>
impl<K: Clone + TName + Ord, V: Clone> Clone for RememberingUniqueMap<K, V>
source§fn clone(&self) -> RememberingUniqueMap<K, V>
fn clone(&self) -> RememberingUniqueMap<K, V>
Returns a copy 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 moresource§impl<K: TName + Debug, V: Debug> Debug for RememberingUniqueMap<K, V>where
K::Key: Debug,
K::Loc: Debug,
impl<K: TName + Debug, V: Debug> Debug for RememberingUniqueMap<K, V>where K::Key: Debug, K::Loc: Debug,
source§impl<'a, K: TName, V> IntoIterator for &'a RememberingUniqueMap<K, V>
impl<'a, K: TName, V> IntoIterator for &'a RememberingUniqueMap<K, V>
source§impl<'a, K: TName, V> IntoIterator for &'a mut RememberingUniqueMap<K, V>
impl<'a, K: TName, V> IntoIterator for &'a mut RememberingUniqueMap<K, V>
source§impl<K: TName, V> IntoIterator for RememberingUniqueMap<K, V>
impl<K: TName, V> IntoIterator for RememberingUniqueMap<K, V>
source§impl<K: TName, V: PartialEq> PartialEq<RememberingUniqueMap<K, V>> for RememberingUniqueMap<K, V>
impl<K: TName, V: PartialEq> PartialEq<RememberingUniqueMap<K, V>> for RememberingUniqueMap<K, V>
source§fn eq(&self, other: &RememberingUniqueMap<K, V>) -> bool
fn eq(&self, other: &RememberingUniqueMap<K, V>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<K: TName, V: Eq> Eq for RememberingUniqueMap<K, V>
Auto Trait Implementations§
impl<K, V> RefUnwindSafe for RememberingUniqueMap<K, V>where K: RefUnwindSafe, V: RefUnwindSafe, <K as TName>::Key: RefUnwindSafe, <K as TName>::Loc: RefUnwindSafe,
impl<K, V> Send for RememberingUniqueMap<K, V>where K: Send, V: Send, <K as TName>::Key: Send, <K as TName>::Loc: Send,
impl<K, V> Sync for RememberingUniqueMap<K, V>where K: Sync, V: Sync, <K as TName>::Key: Sync, <K as TName>::Loc: Sync,
impl<K, V> Unpin for RememberingUniqueMap<K, V>
impl<K, V> UnwindSafe for RememberingUniqueMap<K, V>where K: RefUnwindSafe, V: RefUnwindSafe, <K as TName>::Key: RefUnwindSafe, <K as TName>::Loc: RefUnwindSafe,
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.