pub struct MultiSet<T: Eq + Hash + Clone> { /* private fields */ }Expand description
A multiset: like a set but tracks element multiplicities.
Implementations§
Source§impl<T: Eq + Hash + Clone> MultiSet<T>
impl<T: Eq + Hash + Clone> MultiSet<T>
Sourcepub fn remove_one(&mut self, elem: &T) -> usize
pub fn remove_one(&mut self, elem: &T) -> usize
Remove one occurrence of elem. Returns the new count (0 if absent).
Sourcepub fn distinct_count(&self) -> usize
pub fn distinct_count(&self) -> usize
Number of distinct elements.
Sourcepub fn to_set(&self) -> OxiHashSet<T>
pub fn to_set(&self) -> OxiHashSet<T>
Convert to a plain set (discarding multiplicities).
Trait Implementations§
impl<T: Eq + Eq + Hash + Clone> Eq for MultiSet<T>
impl<T: Eq + Hash + Clone> StructuralPartialEq for MultiSet<T>
Auto Trait Implementations§
impl<T> Freeze for MultiSet<T>
impl<T> RefUnwindSafe for MultiSet<T>where
T: RefUnwindSafe,
impl<T> Send for MultiSet<T>where
T: Send,
impl<T> Sync for MultiSet<T>where
T: Sync,
impl<T> Unpin for MultiSet<T>where
T: Unpin,
impl<T> UnsafeUnpin for MultiSet<T>
impl<T> UnwindSafe for MultiSet<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