pub struct Set<T: Eq + Hash> { /* private fields */ }
Implementations§
Source§impl<T: Eq + Ord + Hash + Copy + Debug> Set<T>
impl<T: Eq + Ord + Hash + Copy + Debug> Set<T>
pub fn empty() -> Self
pub fn unit(item: T) -> Self
pub fn two(item1: T, item2: T) -> Self
pub fn card(&self) -> usize
pub fn insert(&mut self, item: T)
pub fn delete(&mut self, item: T)
pub fn is_empty(&self) -> bool
pub fn contains(&self, item: T) -> bool
pub fn intersect(&mut self, other: &Self)
pub fn union(&mut self, other: &Self)
pub fn remove(&mut self, other: &Self)
pub fn intersects(&self, other: &Self) -> bool
pub fn is_subset_of(&self, other: &Self) -> bool
pub fn to_vec(&self) -> Vec<T>
pub fn from_vec(vec: Vec<T>) -> Self
pub fn equals(&self, other: &Self) -> bool
pub fn retain<F>(&mut self, f: F)
pub fn map<F, U>(&self, f: F) -> Set<U>
pub fn filter_map<F, U>(&self, f: F) -> Set<U>
pub fn clear(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Set<T>
impl<T> RefUnwindSafe for Set<T>where
T: RefUnwindSafe,
impl<T> Send for Set<T>where
T: Send,
impl<T> Sync for Set<T>where
T: Sync,
impl<T> Unpin for Set<T>where
T: Unpin,
impl<T> UnwindSafe for Set<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