pub struct FiniteSet<T: PartialEq> { /* private fields */ }Expand description
A finite set with decidable membership.
Backed by a Vec<T> with no duplicates (in insertion order).
Implementations§
Source§impl<T: PartialEq> FiniteSet<T>
impl<T: PartialEq> FiniteSet<T>
Sourcepub fn insert(&mut self, x: T) -> bool
pub fn insert(&mut self, x: T) -> bool
Insert x if not already present. Returns true if inserted.
Sourcepub fn intersection(&self, other: &Self) -> Selfwhere
T: Clone,
pub fn intersection(&self, other: &Self) -> Selfwhere
T: Clone,
Compute the intersection with another set.
Sourcepub fn difference(&self, other: &Self) -> Selfwhere
T: Clone,
pub fn difference(&self, other: &Self) -> Selfwhere
T: Clone,
Compute the set difference self \ other.
Trait Implementations§
Source§impl<T: PartialEq> FromIterator<T> for FiniteSet<T>
impl<T: PartialEq> FromIterator<T> for FiniteSet<T>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
impl<T: Eq + PartialEq> Eq for FiniteSet<T>
impl<T: PartialEq> StructuralPartialEq for FiniteSet<T>
Auto Trait Implementations§
impl<T> Freeze for FiniteSet<T>
impl<T> RefUnwindSafe for FiniteSet<T>where
T: RefUnwindSafe,
impl<T> Send for FiniteSet<T>where
T: Send,
impl<T> Sync for FiniteSet<T>where
T: Sync,
impl<T> Unpin for FiniteSet<T>where
T: Unpin,
impl<T> UnsafeUnpin for FiniteSet<T>
impl<T> UnwindSafe for FiniteSet<T>where
T: 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