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>

source

pub fn new() -> Self

source

pub fn is_empty(&self) -> bool

source

pub fn len(&self) -> usize

source

pub fn add(&mut self, key: K, value: V) -> Result<(), (K, K::Loc)>

source

pub fn key_gotten(&self, key: &K) -> bool

source

pub fn contains_key(&self, key: &K) -> bool

source

pub fn contains_key_(&self, key_: &K::Key) -> bool

source

pub fn get(&mut self, key: &K) -> Option<&V>

source

pub fn get_mut(&mut self, key: &K) -> Option<&mut V>

source

pub fn get_loc(&mut self, key: &K) -> Option<&K::Loc>

source

pub fn remove(&mut self, key: &K) -> Option<V>

source

pub fn map<V2, F>(self, f: F) -> RememberingUniqueMap<K, V2>where F: FnMut(K, V) -> V2,

source

pub fn ref_map<V2, F>(&self, f: F) -> RememberingUniqueMap<K, V2>where F: FnMut(K, &V) -> V2,

source

pub fn union_with<F>(&self, other: &Self, f: F) -> Selfwhere V: Clone, F: FnMut(&K, &V, &V) -> V,

source

pub fn iter(&self) -> Iter<'_, K, V>

source

pub fn iter_mut(&mut self) -> IterMut<'_, K, V>

source

pub fn maybe_from_opt_iter( iter: impl Iterator<Item = Option<(K, V)>> ) -> Option<Result<RememberingUniqueMap<K, V>, (K::Key, K::Loc, K::Loc)>>

source

pub fn maybe_from_iter( iter: impl Iterator<Item = (K, V)> ) -> Result<RememberingUniqueMap<K, V>, (K::Key, K::Loc, K::Loc)>

source

pub fn into_inner(self) -> UniqueMap<K, V>

source

pub fn remember(self) -> BTreeSet<K>

Trait Implementations§

source§

impl<K: Clone + TName + Ord, V: Clone> Clone for RememberingUniqueMap<K, V>

source§

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)

Performs copy-assignment from source. Read more
source§

impl<K: TName + Debug, V: Debug> Debug for RememberingUniqueMap<K, V>where K::Key: Debug, K::Loc: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, K: TName, V> IntoIterator for &'a RememberingUniqueMap<K, V>

§

type Item = (<K as TName>::Loc, &'a <K as TName>::Key, &'a V)

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, K, V>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, K: TName, V> IntoIterator for &'a mut RememberingUniqueMap<K, V>

§

type Item = (<K as TName>::Loc, &'a <K as TName>::Key, &'a mut V)

The type of the elements being iterated over.
§

type IntoIter = IterMut<'a, K, V>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<K: TName, V> IntoIterator for RememberingUniqueMap<K, V>

§

type Item = (K, V)

The type of the elements being iterated over.
§

type IntoIter = IntoIter<K, V>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<K: TName, V: PartialEq> PartialEq<RememberingUniqueMap<K, V>> for RememberingUniqueMap<K, V>

source§

fn eq(&self, other: &RememberingUniqueMap<K, V>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

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<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V