pub struct OxiHashSet<T>{ /* private fields */ }Expand description
A wrapper around std::collections::HashSet with an extended API.
OxiHashSet<T> provides functional-style operations (map, filter, fold)
alongside the standard set operations (union, intersection, difference).
Implementations§
Source§impl OxiHashSet<String>
impl OxiHashSet<String>
Sourcepub fn insert_str(&mut self, s: &str) -> bool
pub fn insert_str(&mut self, s: &str) -> bool
Insert a &str directly.
Sourcepub fn contains_str(&self, s: &str) -> bool
pub fn contains_str(&self, s: &str) -> bool
Check whether the set contains the given &str.
Sourcepub fn remove_str(&mut self, s: &str) -> bool
pub fn remove_str(&mut self, s: &str) -> bool
Remove by &str.
Source§impl OxiHashSet<u64>
impl OxiHashSet<u64>
Sourcepub fn covers_range(&self, lo: u64, hi: u64) -> bool
pub fn covers_range(&self, lo: u64, hi: u64) -> bool
Check whether the range lo..=hi is completely covered.
Source§impl OxiHashSet<usize>
impl OxiHashSet<usize>
Source§impl<T: Eq + Hash + Clone> OxiHashSet<T>
impl<T: Eq + Hash + Clone> OxiHashSet<T>
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a set with the given capacity pre-allocated.
Source§impl<T: Eq + Hash + Clone> OxiHashSet<T>
impl<T: Eq + Hash + Clone> OxiHashSet<T>
Sourcepub fn difference(&self, other: &Self) -> Self
pub fn difference(&self, other: &Self) -> Self
Return a new set that is the difference self ∖ other.
Source§impl<T: Eq + Hash + Clone> OxiHashSet<T>
impl<T: Eq + Hash + Clone> OxiHashSet<T>
Sourcepub fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
pub fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
Extend with elements from an iterator.
Source§impl<T: Eq + Hash + Clone> OxiHashSet<T>
impl<T: Eq + Hash + Clone> OxiHashSet<T>
Source§impl<T: Eq + Hash + Clone> OxiHashSet<T>
impl<T: Eq + Hash + Clone> OxiHashSet<T>
Sourcepub fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
pub fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Create a set from an iterator.
Source§impl<T: Eq + Hash + Clone> OxiHashSet<T>
impl<T: Eq + Hash + Clone> OxiHashSet<T>
Sourcepub fn insert(&mut self, elem: T) -> bool
pub fn insert(&mut self, elem: T) -> bool
Insert an element. Returns true if the element was not already present.
Sourcepub fn union_with(&mut self, other: &Self)
pub fn union_with(&mut self, other: &Self)
Extend with elements from another set (union in place).
Source§impl<T: Eq + Hash + Clone> OxiHashSet<T>
impl<T: Eq + Hash + Clone> OxiHashSet<T>
Sourcepub fn intersection(&self, other: &Self) -> Self
pub fn intersection(&self, other: &Self) -> Self
Return a new set that is the intersection of self and other.
Source§impl<T: Eq + Hash + Clone> OxiHashSet<T>
impl<T: Eq + Hash + Clone> OxiHashSet<T>
Sourcepub fn exclusive_count(&self, other: &Self) -> usize
pub fn exclusive_count(&self, other: &Self) -> usize
Number of elements not shared with other.
Sourcepub fn union_size(&self, other: &Self) -> usize
pub fn union_size(&self, other: &Self) -> usize
Total elements in union minus shared elements (Jaccard denominator).
Source§impl<T: Eq + Hash + Clone> OxiHashSet<T>
impl<T: Eq + Hash + Clone> OxiHashSet<T>
Sourcepub fn flat_map<U, F>(&self, f: F) -> OxiHashSet<U>
pub fn flat_map<U, F>(&self, f: F) -> OxiHashSet<U>
Flat-map: apply f to each element and union all results.
Source§impl<T: Eq + Hash + Clone> OxiHashSet<T>
impl<T: Eq + Hash + Clone> OxiHashSet<T>
Sourcepub fn is_superset(&self, other: &Self) -> bool
pub fn is_superset(&self, other: &Self) -> bool
Check whether self is a superset of other.
Source§impl<T: Eq + Hash + Clone> OxiHashSet<T>
impl<T: Eq + Hash + Clone> OxiHashSet<T>
Sourcepub fn is_disjoint(&self, other: &Self) -> bool
pub fn is_disjoint(&self, other: &Self) -> bool
Check whether self and other are disjoint (share no elements).
Source§impl<T: Eq + Hash + Clone> OxiHashSet<T>
impl<T: Eq + Hash + Clone> OxiHashSet<T>
Sourcepub fn symmetric_difference(&self, other: &Self) -> Self
pub fn symmetric_difference(&self, other: &Self) -> Self
Return a new set that is the symmetric difference of self and other.
Trait Implementations§
Source§impl<T> Clone for OxiHashSet<T>
impl<T> Clone for OxiHashSet<T>
Source§fn clone(&self) -> OxiHashSet<T>
fn clone(&self) -> OxiHashSet<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more