Implementations
sourceimpl<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) where
F: FnMut(&T) -> bool,
pub fn map<F, U>(&self, f: F) -> Set<U> where
F: Fn(&T) -> U,
U: Eq + Ord + Hash + Copy + Debug,
pub fn filter_map<F, U>(&self, f: F) -> Set<U> where
F: Fn(&T) -> Option<U>,
U: Eq + Ord + Hash + Copy + Debug,
pub fn clear(&mut self)
Trait Implementations
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more