pub struct Set<V>(/* private fields */);Implementations§
Source§impl<V: Ord> Set<V>
impl<V: Ord> Set<V>
pub fn new() -> Selfwhere
V: Ord,
pub fn singleton(v: V) -> Self
pub fn insert_with(&mut self, k: V, f: impl Fn(V) -> V)
pub fn insert(&mut self, k: V)
pub fn append_with<FF, It>(&mut self, it: It, f: &FF) -> &mut Self
pub fn pop_first(&mut self) -> Option<V>
pub fn append<It>(&mut self, it: It) -> &mut Selfwhere
It: Iterator<Item = V>,
pub fn first(&self) -> Option<&V>
pub fn contains(&self, k: &V) -> bool
pub fn is_empty(&self) -> bool
Sourcepub fn union_with<FF>(&self, other: Set<V>, f: &FF) -> Self
pub fn union_with<FF>(&self, other: Set<V>, f: &FF) -> Self
Union of two sets with conflict hanlder [f]
Sourcepub fn intersection(&self, other: Set<V>) -> Selfwhere
V: Clone,
pub fn intersection(&self, other: Set<V>) -> Selfwhere
V: Clone,
Intersection of two sets
pub fn iter(&self) -> SetIterator<'_, V> ⓘ
pub fn modify<F>(&mut self, f: F)
pub fn extract_if(&mut self, f: impl Fn(&V) -> bool) -> Set<V>where
V: Clone,
pub fn retain(&mut self, f: impl Fn(&V) -> bool)
Trait Implementations§
Source§impl<V> FromIterator<V> for Set<V>where
V: Ord,
impl<V> FromIterator<V> for Set<V>where
V: Ord,
Source§fn from_iter<I: IntoIterator<Item = V>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = V>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<V> IntoIterator for Set<V>
impl<V> IntoIterator for Set<V>
Source§impl<'a, D, A, V> Pretty<'a, D, A> for Set<V>
Pretty printer instance
impl<'a, D, A, V> Pretty<'a, D, A> for Set<V>
Pretty printer instance
Source§fn pretty(self, allocator: &'a D) -> DocBuilder<'a, D, A>
fn pretty(self, allocator: &'a D) -> DocBuilder<'a, D, A>
Converts
self into a documentimpl<V: Eq> Eq for Set<V>
impl<V> StructuralPartialEq for Set<V>
Auto Trait Implementations§
impl<V> Freeze for Set<V>
impl<V> RefUnwindSafe for Set<V>where
V: RefUnwindSafe,
impl<V> Send for Set<V>where
V: Send,
impl<V> Sync for Set<V>where
V: Sync,
impl<V> Unpin for Set<V>
impl<V> UnwindSafe for Set<V>where
V: RefUnwindSafe,
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