Struct move_lang::shared::unique_set::UniqueSet
source · pub struct UniqueSet<T: TName>(_);
Expand description
Unique set wrapper around UniqueMap
where the value of the map is not needed
Implementations§
source§impl<T: TName> UniqueSet<T>
impl<T: TName> UniqueSet<T>
pub fn new() -> Self
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn add(&mut self, x: T) -> Result<(), (T, T::Loc)>
pub fn remove(&mut self, x: &T) -> bool
pub fn remove_(&mut self, x: &T::Key) -> bool
pub fn contains(&self, x: &T) -> bool
pub fn contains_(&self, x_: &T::Key) -> bool
pub fn get_loc(&self, x: &T) -> Option<&T::Loc>
pub fn get_loc_(&self, x_: &T::Key) -> Option<&T::Loc>
pub fn intersect(&self, other: &Self) -> Self
pub fn union(&self, other: &Self) -> Self
pub fn is_subset(&self, other: &Self) -> bool
pub fn iter(&self) -> Iter<'_, T> ⓘ
pub fn cloned_iter(&self) -> impl Iterator<Item = T>
pub fn from_elements( iter: impl IntoIterator<Item = T> ) -> Result<Self, (T::Key, T::Loc, T::Loc)>
pub fn from_elements_( loc: T::Loc, iter: impl IntoIterator<Item = T::Key> ) -> Result<Self, (T::Key, T::Loc, T::Loc)>
Trait Implementations§
source§impl<'a, T: TName> IntoIterator for &'a UniqueSet<T>
impl<'a, T: TName> IntoIterator for &'a UniqueSet<T>
source§impl<T: TName> IntoIterator for UniqueSet<T>
impl<T: TName> IntoIterator for UniqueSet<T>
source§impl<T: TName> Ord for UniqueSet<T>
impl<T: TName> Ord for UniqueSet<T>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<T: TName> PartialEq<UniqueSet<T>> for UniqueSet<T>
impl<T: TName> PartialEq<UniqueSet<T>> for UniqueSet<T>
source§impl<T: TName> PartialOrd<UniqueSet<T>> for UniqueSet<T>
impl<T: TName> PartialOrd<UniqueSet<T>> for UniqueSet<T>
1.0.0 · source§fn 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 moreimpl<T: TName> Eq for UniqueSet<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for UniqueSet<T>where <T as TName>::Key: RefUnwindSafe, <T as TName>::Loc: RefUnwindSafe,
impl<T> Send for UniqueSet<T>where <T as TName>::Key: Send, <T as TName>::Loc: Send,
impl<T> Sync for UniqueSet<T>where <T as TName>::Key: Sync, <T as TName>::Loc: Sync,
impl<T> Unpin for UniqueSet<T>
impl<T> UnwindSafe for UniqueSet<T>where <T as TName>::Key: RefUnwindSafe, <T 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.