Struct move_compiler::shared::unique_map::UniqueMap   
source · [−]pub struct UniqueMap<K: TName, V>(_);Expand description
Unique wrapper around BTreeMap that throws on duplicate inserts
Implementations
sourceimpl<K: TName, V> UniqueMap<K, V>
 
impl<K: TName, V> UniqueMap<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 contains_key(&self, key: &K) -> bool
pub fn contains_key_(&self, key_: &K::Key) -> bool
pub fn get(&self, key: &K) -> Option<&V>
pub fn get_(&self, key_: &K::Key) -> Option<&V>
pub fn get_mut(&mut self, key: &K) -> Option<&mut V>
pub fn get_mut_(&mut self, key_: &K::Key) -> Option<&mut V>
pub fn get_loc(&self, key: &K) -> Option<&K::Loc>
pub fn get_loc_(&self, key_: &K::Key) -> Option<&K::Loc>
pub fn get_key(&self, key: &K) -> Option<&K::Key>
pub fn remove(&mut self, key: &K) -> Option<V>
pub fn remove_(&mut self, key_: &K::Key) -> Option<V>
pub fn map<V2, F>(self, f: F) -> UniqueMap<K, V2> where
    F: FnMut(K, V) -> V2, 
pub fn filter_map<V2, F>(self, f: F) -> UniqueMap<K, V2> where
    F: FnMut(K, V) -> Option<V2>, 
pub fn ref_map<V2, F>(&self, f: F) -> UniqueMap<K, V2> where
    F: FnMut(K, &V) -> V2, 
pub fn union_with<F>(&self, other: &Self, f: F) -> Self where
    V: Clone,
    F: FnMut(&K, &V, &V) -> V, 
pub fn iter(&self) -> Iter<'_, K, V>ⓘNotable traits for Iter<'a, K, V>impl<'a, K: TName, V> Iterator for Iter<'a, K, V>    type Item = (K::Loc, &'a K::Key, &'a V);
pub fn key_cloned_iter(&self) -> impl Iterator<Item = (K, &V)>
pub fn iter_mut(&mut self) -> IterMut<'_, K, V>ⓘNotable traits for IterMut<'a, K, V>impl<'a, K: TName, V> Iterator for IterMut<'a, K, V>    type Item = (K::Loc, &'a K::Key, &'a mut V);
pub fn maybe_from_opt_iter(
    iter: impl Iterator<Item = Option<(K, V)>>
) -> Option<Result<UniqueMap<K, V>, (K::Key, K::Loc, K::Loc)>>
pub fn maybe_from_iter(
    iter: impl Iterator<Item = (K, V)>
) -> Result<UniqueMap<K, V>, (K::Key, K::Loc, K::Loc)>
Trait Implementations
sourceimpl<K: Clone + TName, V: Clone> Clone for UniqueMap<K, V> where
    K::Key: Clone,
    K::Loc: Clone, 
 
impl<K: Clone + TName, V: Clone> Clone for UniqueMap<K, V> where
    K::Key: Clone,
    K::Loc: Clone, 
sourceimpl<K: Debug + TName, V: Debug> Debug for UniqueMap<K, V> where
    K::Key: Debug,
    K::Loc: Debug, 
 
impl<K: Debug + TName, V: Debug> Debug for UniqueMap<K, V> where
    K::Key: Debug,
    K::Loc: Debug, 
sourceimpl<K: Default + TName, V: Default> Default for UniqueMap<K, V> where
    K::Key: Default,
    K::Loc: Default, 
 
impl<K: Default + TName, V: Default> Default for UniqueMap<K, V> where
    K::Key: Default,
    K::Loc: Default, 
sourceimpl<'a, K: TName, V> IntoIterator for &'a UniqueMap<K, V>
 
impl<'a, K: TName, V> IntoIterator for &'a UniqueMap<K, V>
sourceimpl<'a, K: TName, V> IntoIterator for &'a mut UniqueMap<K, V>
 
impl<'a, K: TName, V> IntoIterator for &'a mut UniqueMap<K, V>
sourceimpl<K: TName, V> IntoIterator for UniqueMap<K, V>
 
impl<K: TName, V> IntoIterator for UniqueMap<K, V>
sourceimpl<K: TName, V: Ord> Ord for UniqueMap<K, V>
 
impl<K: TName, V: Ord> Ord for UniqueMap<K, V>
sourceimpl<K: TName, V: PartialOrd> PartialOrd<UniqueMap<K, V>> for UniqueMap<K, V>
 
impl<K: TName, V: PartialOrd> PartialOrd<UniqueMap<K, V>> for UniqueMap<K, V>
sourcefn partial_cmp(&self, other: &UniqueMap<K, V>) -> Option<Ordering>
 
fn partial_cmp(&self, other: &UniqueMap<K, V>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
 
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
 
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<K: TName, V: Eq> Eq for UniqueMap<K, V>
Auto Trait Implementations
impl<K, V> RefUnwindSafe for UniqueMap<K, V> where
    V: RefUnwindSafe,
    <K as TName>::Key: RefUnwindSafe,
    <K as TName>::Loc: RefUnwindSafe, 
impl<K, V> Send for UniqueMap<K, V> where
    V: Send,
    <K as TName>::Key: Send,
    <K as TName>::Loc: Send, 
impl<K, V> Sync for UniqueMap<K, V> where
    V: Sync,
    <K as TName>::Key: Sync,
    <K as TName>::Loc: Sync, 
impl<K, V> Unpin for UniqueMap<K, V>
impl<K, V> UnwindSafe for UniqueMap<K, V> where
    V: RefUnwindSafe,
    <K as TName>::Key: RefUnwindSafe,
    <K as TName>::Loc: RefUnwindSafe, 
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
    T: ?Sized, 
 
impl<T> BorrowMut<T> for T where
    T: ?Sized, 
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
    Q: Eq + ?Sized,
    K: Borrow<Q> + ?Sized, 
 
impl<Q, K> Equivalent<K> for Q where
    Q: Eq + ?Sized,
    K: Borrow<Q> + ?Sized, 
sourcefn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.