pub struct Multiset<N: Counter, const SIZE: usize> { /* private fields */ }
Expand description
A stack allocated multiset of unsigned integers.
Each index in the Multiset
array corresponds to an element in the
multiset. If the value at an index is 0 then there are no instances of the
corresponding uint in the multiset. Because of this correspondence the
order of the counts must remain consistent for any Multiset
to behave
consistently.
Examples
use utote::Multiset;
// A multiset of 5 elements, which can be counted up to u8::MAX
let mut multiset = Multiset::from([0u8, 3, 4, 0, 5]);
assert_eq!(multiset.total(), 12);
let equivalent_multiset = Multiset::<u8, 5>::from([0, 3, 4, 0, 5]);
assert_eq!(multiset, equivalent_multiset);
multiset.insert(2, 6);
assert_eq!(multiset, Multiset::from([0, 3, 6, 0, 5]));
for elem in multiset.iter() {
println!("{}", elem);
}
assert_eq!(multiset.contains(0), false);
assert_eq!(multiset.contains(1), true);
Some common set-like operations:
use utote::Multiset;
let ms_sub: Multiset<u32, 3> = Multiset::from([0, 1, 1]);
let ms_super = Multiset::from([1, 1, 2]);
assert_eq!(ms_sub.is_subset(&ms_super), true);
assert_eq!(ms_sub.union(&ms_super), Multiset::from([1, 1, 2]));
assert_eq!(ms_super.is_proper_superset(&ms_sub), true);
// Any multiset where all counters are zero is equivalent to
// the empty multiset.
let empty: Multiset<u64, 2> = Multiset::from([0, 0]);
assert_eq!(empty, Multiset::empty());
Indexing
The Multiset
type allows accessing values by index in the same manner
that Vec
does.
use utote::Multiset;
let multiset = Multiset::from([1u16, 2, 3]);
println!("{}", multiset[1]); // it will display '2'
As with slice
, get
and get_mut
are provided (along with
unchecked versions).
Using Generically
The Counter
trait is provided to simplify using Multiset
generically.
Counter
is implemented for all unsigned integers.
use utote::{Counter, Multiset};
fn generic_ms<T: Counter, const SIZE: usize>(ms: Multiset<T, SIZE>) {
println!("{}", ms.is_empty());
}
Implementations§
source§impl<N: Counter, const SIZE: usize> Multiset<N, SIZE>
impl<N: Counter, const SIZE: usize> Multiset<N, SIZE>
sourcepub fn new(data: [N; SIZE]) -> Multiset<N, SIZE>
pub fn new(data: [N; SIZE]) -> Multiset<N, SIZE>
Constructs a new Multiset.
This method is equivalent to calling Multiset::from
with an array
of the correct type.
Examples
use utote::Multiset;
let multiset = Multiset::new([1u8, 2, 3, 4]);
let multiset_from = Multiset::from([1, 2, 3, 4]);
assert_eq!(multiset, multiset_from);
sourcepub fn empty() -> Self
pub fn empty() -> Self
Returns a Multiset of the given array size with all element counts set to zero.
Multiset::default
will also construct an empty set.
Examples
use utote::Multiset;
let empty_multiset = Multiset::<u8, 4>::empty();
assert_eq!(empty_multiset, Multiset::from([0, 0, 0, 0]));
assert_eq!(empty_multiset, Multiset::default());
sourcepub fn repeat(count: N) -> Self
pub fn repeat(count: N) -> Self
Returns a Multiset of the given array size with all elements set to
count
.
Examples
use utote::Multiset;
let multiset = Multiset::<u8, 4>::repeat(5);
assert_eq!(multiset, Multiset::from([5, 5, 5, 5]))
sourcepub fn from_elements<'a, I>(elements: I) -> Selfwhere
I: IntoIterator<Item = &'a usize>,
pub fn from_elements<'a, I>(elements: I) -> Selfwhere
I: IntoIterator<Item = &'a usize>,
Constructs a Multiset from an iterator of elements in the multiset, incrementing the count of each element as it occurs in the iterator.
Panics
If any item in the iterator is out of bounds of the Multiset.
Examples
use utote::Multiset;
let multiset = Multiset::<u8, 4>::from_elements(&[1, 1, 0, 2, 2, 2]);
assert_eq!(multiset, Multiset::from([1, 2, 3, 0]))
sourcepub fn iter_mut(&mut self) -> IterMut<'_, N>
pub fn iter_mut(&mut self) -> IterMut<'_, N>
Return a IterMut of the element counts in the Multiset.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Sets all element counts in the multiset to zero.
Examples
use utote::Multiset;
let mut multiset = Multiset::<u8, 4>::from([1, 2, 3, 4]);
multiset.clear();
assert_eq!(multiset.is_empty(), true);
sourcepub fn contains(&self, elem: usize) -> bool
pub fn contains(&self, elem: usize) -> bool
Returns true
if elem
has count > 0 in the multiset.
Examples
use utote::Multiset;
let multiset = Multiset::from([1u8, 2, 0, 0]);
assert_eq!(multiset.contains(1), true);
assert_eq!(multiset.contains(3), false);
assert_eq!(multiset.contains(5), false);
sourcepub unsafe fn contains_unchecked(&self, elem: usize) -> bool
pub unsafe fn contains_unchecked(&self, elem: usize) -> bool
Returns true
if elem
has count > 0 in the multiset, without doing
bounds checking.
For a safe alternative see contains
.
Safety
Calling this method with an out-of-bounds index is undefined behavior even if the resulting boolean is not used.
Examples
use utote::Multiset;
let multiset = Multiset::from([1u8, 2, 0, 0]);
unsafe {
assert_eq!(multiset.contains_unchecked(1), true);
assert_eq!(multiset.contains_unchecked(3), false);
}
sourcepub fn insert(&mut self, elem: usize, amount: N)
pub fn insert(&mut self, elem: usize, amount: N)
Set the count of elem
in the multiset to amount
.
Examples
use utote::Multiset;
let mut multiset = Multiset::from([1u8, 2, 0, 0]);
multiset.insert(2, 5);
assert_eq!(multiset.get(2), Some(&5));
sourcepub unsafe fn insert_unchecked(&mut self, elem: usize, amount: N)
pub unsafe fn insert_unchecked(&mut self, elem: usize, amount: N)
Set the count of elem
in the multiset to amount
, without doing
bounds checking.
For a safe alternative see insert
.
Safety
Calling this method with an out-of-bounds index is undefined behavior.
Examples
use utote::Multiset;
let mut multiset = Multiset::from([1u8, 2, 0, 0]);
unsafe {
multiset.insert_unchecked(2, 5);
assert_eq!(multiset.get(2), Some(&5));
}
sourcepub fn remove(&mut self, elem: usize)
pub fn remove(&mut self, elem: usize)
Set the count of elem
in the multiset to zero.
Examples
use utote::Multiset;
let mut multiset = Multiset::from([1u8, 2, 0, 0]);
multiset.remove(1);
assert_eq!(multiset.get(1), Some(&0));
sourcepub unsafe fn remove_unchecked(&mut self, elem: usize)
pub unsafe fn remove_unchecked(&mut self, elem: usize)
Set the count of elem
in the multiset to zero, without doing bounds
checking.
For a safe alternative see remove
.
Safety
Calling this method with an out-of-bounds index is undefined behavior.
Examples
use utote::Multiset;
let mut multiset = Multiset::from([1u8, 2, 0, 0]);
unsafe {
multiset.remove_unchecked(1);
assert_eq!(multiset.get(1), Some(&0));
}
sourcepub fn get<I>(&self, index: I) -> Option<&I::Output>where
I: SliceIndex<[N]>,
pub fn get<I>(&self, index: I) -> Option<&I::Output>where
I: SliceIndex<[N]>,
Returns a reference to a count or subslice of counts depending on the type of index.
- If given a position, returns a reference to the count at that
position or
None
if out of bounds. - If given a range, returns the subslice corresponding to that range,
or
None
if out of bounds.
Examples
use utote::Multiset;
let multiset = Multiset::from([1u8, 2, 0, 0]);
assert_eq!(multiset.get(1), Some(&2));
assert_eq!(multiset.get(2..), Some(&[0, 0][..]));
assert_eq!(multiset.get(5), None);
assert_eq!(multiset.get(0..5), None);
sourcepub fn get_mut<I>(&mut self, index: I) -> Option<&mut I::Output>where
I: SliceIndex<[N]>,
pub fn get_mut<I>(&mut self, index: I) -> Option<&mut I::Output>where
I: SliceIndex<[N]>,
Returns a mutable reference to a count or subslice of counts depending
on the type of index (see get
) or None
if the index is out of
bounds.
Examples
use utote::Multiset;
let mut multiset = Multiset::from([1u8, 2, 4]);
if let Some(elem) = multiset.get_mut(1) {
*elem = 42;
}
assert_eq!(multiset, Multiset::from([1u8, 42, 4]));
sourcepub unsafe fn get_unchecked<I>(&self, index: I) -> &I::Outputwhere
I: SliceIndex<[N]>,
pub unsafe fn get_unchecked<I>(&self, index: I) -> &I::Outputwhere
I: SliceIndex<[N]>,
Returns a reference to a count or subslice of counts, without doing bounds checking.
For a safe alternative see get
.
Safety
Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used.
Examples
use utote::Multiset;
let multiset = Multiset::from([1u32, 2, 0, 0]);
unsafe {
assert_eq!(multiset.get_unchecked(1), &2);
}
sourcepub unsafe fn get_unchecked_mut<I>(&mut self, index: I) -> &mut I::Outputwhere
I: SliceIndex<[N]>,
pub unsafe fn get_unchecked_mut<I>(&mut self, index: I) -> &mut I::Outputwhere
I: SliceIndex<[N]>,
Returns a mutable reference to a count or subslice of counts, without doing bounds checking.
For a safe alternative see get_mut
.
Safety
Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used.
Examples
use utote::Multiset;
let mut multiset = Multiset::from([1u8, 2, 4]);
unsafe {
let elem = multiset.get_unchecked_mut(1);
*elem = 13;
}
assert_eq!(multiset, Multiset::from([1u8, 13, 4]));
sourcepub fn intersection(&self, other: &Self) -> Self
pub fn intersection(&self, other: &Self) -> Self
Returns a multiset which is the intersection of self
and other
.
The Intersection of two multisets is the counts of elements which
occurs in both. A
intersection B
is the multiset C
where
C[i] == min(A[i], B[i])
for all i
in C
.
Examples
use utote::Multiset;
let a = Multiset::from([1u8, 2, 0, 0]);
let b = Multiset::from([0, 1, 3, 0]);
let c = Multiset::from([0, 1, 0, 0]);
assert_eq!(a.intersection(&b), c);
sourcepub fn union(&self, other: &Self) -> Self
pub fn union(&self, other: &Self) -> Self
Returns a multiset which is the union of self
and other
.
The union of two multisets is the counts of elements which occur in
either, without repeats. A
union B
is the multiset C
where
C[i] == max(A[i], B[i])
for all i
in C
.
Examples
use utote::Multiset;
let a = Multiset::from([1u8, 2, 0, 0]);
let b = Multiset::from([0, 1, 3, 0]);
let c = Multiset::from([1, 2, 3, 0]);
assert_eq!(a.union(&b), c);
sourcepub fn difference(&self, other: &Self) -> Self
pub fn difference(&self, other: &Self) -> Self
Returns a multiset which is the difference of self
and other
.
The difference of this multiset and another is the count of elements in
this and those that occur in this and other without repeats. A
difference B
is the multiset C
where C[i] == min(A[i], B[i])
if
A[i] > 0
and B[i] > 0
, otherwise A[i]
for all i
in C
.
Examples
use utote::Multiset;
let a = Multiset::from([1u8, 2, 0, 0]);
let b = Multiset::from([0, 1, 3, 0]);
let c = Multiset::from([1, 1, 0, 0]);
assert_eq!(a.difference(&b), c);
sourcepub fn symmetric_difference(&self, other: &Self) -> Self
pub fn symmetric_difference(&self, other: &Self) -> Self
Returns a multiset which is the symmetric_difference of self
and
other
.
The symmetric_difference of two multisets is the count of elements that
occur in either, and the count, without repeats that occurs in both.
A
symmetric_difference B
is the multiset C
where
C[i] == min(A[i], B[i])
if A[i] > 0
and B[i] > 0
, otherwise
max(A[i], B[i])
for all i
in C
.
Examples
use utote::Multiset;
let a = Multiset::from([1u8, 2, 0, 0]);
let b = Multiset::from([0, 1, 3, 0]);
let c = Multiset::from([1, 1, 3, 0]);
assert_eq!(a.symmetric_difference(&b), c);
sourcepub fn count_non_zero(&self) -> usize
pub fn count_non_zero(&self) -> usize
Returns the number of elements whose count is non-zero.
Examples
use utote::Multiset;
let multiset = Multiset::from([1u8, 0, 0, 0]);
assert_eq!(multiset.count_non_zero(), 1);
sourcepub fn count_zero(&self) -> usize
pub fn count_zero(&self) -> usize
Returns the number of elements whose count is zero.
Examples
use utote::Multiset;
let multiset = Multiset::from([1u8, 0, 0, 0]);
assert_eq!(multiset.count_zero(), 3);
sourcepub fn is_singleton(&self) -> bool
pub fn is_singleton(&self) -> bool
Returns true
if only one element in the multiset has a non-zero
count.
Examples
use utote::Multiset;
let multiset = Multiset::from([0u8, 5, 0, 0]);
assert_eq!(multiset.is_singleton(), true);
sourcepub fn is_disjoint(&self, other: &Self) -> bool
pub fn is_disjoint(&self, other: &Self) -> bool
Returns true
if self
is disjoint to other
.
Multiset A
is disjoint to B
if A
has no elements in common with
B
. A
is disjoint B
if min(A[i], B[i]) == 0
for all i
in
A
.
Examples
use utote::Multiset;
let a = Multiset::from([1u8, 2, 0, 0]);
assert_eq!(a.is_disjoint(&a), false);
let b = Multiset::from([0, 0, 3, 4]);
assert_eq!(a.is_disjoint(&b), true);
let c = Multiset::from([0, 1, 1, 0]);
assert_eq!(a.is_disjoint(&c), false);
sourcepub fn is_subset(&self, other: &Self) -> bool
pub fn is_subset(&self, other: &Self) -> bool
Returns true
if self
is a subset of other
.
Multiset A
is a subset of B
if all the element counts in A
are
less than or equal to the counts in B
. A
is subset B
if
A[i] <= B[i]
for all i
in A
.
Examples
use utote::Multiset;
let a = Multiset::from([1u64, 2, 0, 0]);
assert_eq!(a.is_subset(&a), true);
let b = Multiset::from([1, 3, 0, 0]);
assert_eq!(a.is_subset(&b), true);
assert_eq!(a.is_subset(&Multiset::empty()), false);
sourcepub fn is_superset(&self, other: &Self) -> bool
pub fn is_superset(&self, other: &Self) -> bool
Returns true
if self
is a superset of other
.
Multiset A
is a subset of B
if all the element counts in A
are
greater than or equal to the counts in B
. A
is superset B
if
A[i] >= B[i]
for all i
in A
.
Examples
use utote::Multiset;
let a = Multiset::from([1u8, 2, 0, 0]);
assert_eq!(a.is_superset(&a), true);
let b = Multiset::from([1, 1, 0, 0]);
assert_eq!(a.is_superset(&b), true);
assert_eq!(a.is_superset(&Multiset::empty()), true);
sourcepub fn is_proper_subset(&self, other: &Self) -> bool
pub fn is_proper_subset(&self, other: &Self) -> bool
Returns true
if self
is a proper subset of other
.
Multiset A
is a proper subset of B
if A
is a subset of B
and at
least one element count of A
is less than that element count in B
.
A
is proper subset B
if A[i] <= B[i]
for all i
in A
and there
exists j
such that A[j] < B[j]
.
Examples
use utote::Multiset;
let a = Multiset::from([1u8, 2, 0, 0]);
assert_eq!(a.is_proper_subset(&a), false);
let b = Multiset::from([1, 3, 0, 0]);
assert_eq!(a.is_proper_subset(&b), true);
sourcepub fn is_proper_superset(&self, other: &Self) -> bool
pub fn is_proper_superset(&self, other: &Self) -> bool
Returns true
if self
is a proper superset of other
.
Multiset A
is a proper superset of B
if A
is a superset of B
and at least one element count of A
is greater than that element
count in B
. A
is proper superset B
if A[i] >= B[i]
for all i
in A
and there exists j
such that A[j] > B[j]
.
Examples
use utote::Multiset;
let a = Multiset::from([1u8, 2, 0, 0]);
assert_eq!(a.is_proper_superset(&a), false);
let b = Multiset::from([1, 1, 0, 0]);
assert_eq!(a.is_proper_superset(&b), true);
sourcepub fn is_any_lesser(&self, other: &Self) -> bool
pub fn is_any_lesser(&self, other: &Self) -> bool
Returns true
if any element count in self
is less than that element
count in other
.
A
is any lesser B
if there exists some i
such that A[i] < B[i]
.
Examples
use utote::Multiset;
let a = Multiset::from([1u8, 2, 4, 0]);
assert_eq!(a.is_any_lesser(&a), false);
let b = Multiset::from([1, 3, 0, 0]);
assert_eq!(a.is_any_lesser(&b), true);
sourcepub fn is_any_greater(&self, other: &Self) -> bool
pub fn is_any_greater(&self, other: &Self) -> bool
Returns true
if any element count in self
is greater than that
element count in other
.
A
is any greater B
if there exists some i
such that
A[i] > B[i]
.
Examples
use utote::Multiset;
let a = Multiset::from([1u8, 2, 0, 0]);
assert_eq!(a.is_any_greater(&a), false);
let b = Multiset::from([1, 1, 4, 0]);
assert_eq!(a.is_any_greater(&b), true);
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true
if all elements have a count of zero.
Examples
use utote::Multiset;
let multiset = Multiset::from([0u8, 0, 0, 0]);
assert_eq!(multiset.is_empty(), true);
assert_eq!(Multiset::<u8, 4>::empty().is_empty(), true);
sourcepub fn total(&self) -> usize
pub fn total(&self) -> usize
The total or cardinality of a multiset is the sum of all element counts.
This function converts counts to usize
to try and avoid overflows.
Examples
use utote::Multiset;
let multiset = Multiset::from([1u8, 2, 3, 4]);
assert_eq!(multiset.total(), 10);
sourcepub fn elem_count_max(&self) -> (usize, &N)
pub fn elem_count_max(&self) -> (usize, &N)
Returns a tuple containing the element and a reference to the largest count in the multiset.
Examples
use utote::Multiset;
let multiset = Multiset::from([2u16, 0, 5, 3]);
assert_eq!(multiset.elem_count_max(), (2, &5));
sourcepub fn elem_max(&self) -> usize
pub fn elem_max(&self) -> usize
Returns the element with the largest count in the multiset.
Examples
use utote::Multiset;
let multiset = Multiset::from([2u8, 0, 5, 3]);
assert_eq!(multiset.elem_max(), 2);
sourcepub fn count_max(&self) -> &N
pub fn count_max(&self) -> &N
Returns a reference to the largest count in the multiset.
Examples
use utote::Multiset;
let multiset = Multiset::from([2u8, 0, 5, 3]);
assert_eq!(multiset.count_max(), &5);
sourcepub fn elem_count_min(&self) -> (usize, &N)
pub fn elem_count_min(&self) -> (usize, &N)
Returns a tuple containing the element and a reference to the smallest count in the multiset.
Examples
use utote::Multiset;
let multiset = Multiset::from([2u8, 0, 5, 3]);
assert_eq!(multiset.elem_count_min(), (1, &0));
sourcepub fn elem_min(&self) -> usize
pub fn elem_min(&self) -> usize
Returns the element with the smallest count in the multiset.
Examples
use utote::Multiset;
let multiset = Multiset::from([2u8, 0, 5, 3]);
assert_eq!(multiset.elem_min(), 1);
sourcepub fn count_min(&self) -> &N
pub fn count_min(&self) -> &N
Returns a reference to the smallest count in the multiset.
Examples
use utote::Multiset;
let multiset = Multiset::from([2u8, 0, 5, 3]);
assert_eq!(multiset.count_min(), &0);
sourcepub fn choose(&mut self, elem: usize)
pub fn choose(&mut self, elem: usize)
Set all element counts, except for the given elem
, to zero.
Examples
use utote::Multiset;
let mut multiset = Multiset::from([2u8, 0, 5, 3]);
multiset.choose(2);
let result = Multiset::from([0, 0, 5, 0]);
assert_eq!(multiset, result);
sourcepub fn choose_random<T: RngCore>(&mut self, rng: &mut T)
pub fn choose_random<T: RngCore>(&mut self, rng: &mut T)
Set all element counts, except for a random choice, to zero.
The choice is weighted by the counts of the elements, and unless the multiset is empty an element with non-zero count will always be chosen.
Examples
use utote::Multiset;
use rand::prelude::*;
let rng = &mut StdRng::seed_from_u64(thread_rng().next_u64());
let mut multiset = Multiset::from([2u8, 0, 5, 3]);
multiset.choose_random(rng);
assert_eq!(multiset.is_singleton(), true);
sourcepub fn collision_entropy(&self) -> f64
pub fn collision_entropy(&self) -> f64
Calculate the collision entropy of the multiset.
Examples
use utote::Multiset;
let multiset = Multiset::from([2u8, 1, 1, 0]);
let result = multiset.collision_entropy();
// approximate: result == 1.415037499278844
Warning
Should not be used if Multiset::total
or any counter in the
multiset cannot be converted to f64
. The conversions are handled by
AsPrimitive<f64>
.
sourcepub fn shannon_entropy(&self) -> f64
pub fn shannon_entropy(&self) -> f64
Calculate the shannon entropy of the multiset. Uses ln rather than log2.
Examples
use utote::Multiset;
let multiset = Multiset::from([2u8, 1, 1, 0]);
let result = multiset.shannon_entropy();
// approximate: result == 1.0397207708399179
Warning
Should not be used if Multiset::total
or any counter in the
multiset cannot be converted to f64
. The conversions are handled by
AsPrimitive<f64>
.
Trait Implementations§
source§impl<N: Counter, const SIZE: usize> AddAssign<N> for Multiset<N, SIZE>
impl<N: Counter, const SIZE: usize> AddAssign<N> for Multiset<N, SIZE>
source§fn add_assign(&mut self, rhs: N)
fn add_assign(&mut self, rhs: N)
+=
operation. Read moresource§impl<N: Counter, const SIZE: usize> AddAssign for Multiset<N, SIZE>
impl<N: Counter, const SIZE: usize> AddAssign for Multiset<N, SIZE>
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+=
operation. Read moresource§impl<N: Counter, const SIZE: usize> DivAssign<N> for Multiset<N, SIZE>
impl<N: Counter, const SIZE: usize> DivAssign<N> for Multiset<N, SIZE>
source§fn div_assign(&mut self, rhs: N)
fn div_assign(&mut self, rhs: N)
/=
operation. Read moresource§impl<N: Counter, const SIZE: usize> DivAssign for Multiset<N, SIZE>
impl<N: Counter, const SIZE: usize> DivAssign for Multiset<N, SIZE>
source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
/=
operation. Read moresource§impl<N: Counter, const SIZE: usize> FromIterator<N> for Multiset<N, SIZE>
impl<N: Counter, const SIZE: usize> FromIterator<N> for Multiset<N, SIZE>
source§fn from_iter<T: IntoIterator<Item = N>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = N>>(iter: T) -> Self
source§impl<N: Counter, const SIZE: usize> MulAssign<N> for Multiset<N, SIZE>
impl<N: Counter, const SIZE: usize> MulAssign<N> for Multiset<N, SIZE>
source§fn mul_assign(&mut self, rhs: N)
fn mul_assign(&mut self, rhs: N)
*=
operation. Read moresource§impl<N: Counter, const SIZE: usize> MulAssign for Multiset<N, SIZE>
impl<N: Counter, const SIZE: usize> MulAssign for Multiset<N, SIZE>
source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
*=
operation. Read moresource§impl<N: Counter, const SIZE: usize> PartialEq for Multiset<N, SIZE>
impl<N: Counter, const SIZE: usize> PartialEq for Multiset<N, SIZE>
source§impl<N: Counter, const SIZE: usize> PartialOrd for Multiset<N, SIZE>
impl<N: Counter, const SIZE: usize> PartialOrd for Multiset<N, SIZE>
Partial order based on proper sub/super sets
source§impl<N: Counter, const SIZE: usize> RemAssign<N> for Multiset<N, SIZE>
impl<N: Counter, const SIZE: usize> RemAssign<N> for Multiset<N, SIZE>
source§fn rem_assign(&mut self, rhs: N)
fn rem_assign(&mut self, rhs: N)
%=
operation. Read moresource§impl<N: Counter, const SIZE: usize> RemAssign for Multiset<N, SIZE>
impl<N: Counter, const SIZE: usize> RemAssign for Multiset<N, SIZE>
source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
%=
operation. Read moresource§impl<N: Counter, const SIZE: usize> SubAssign<N> for Multiset<N, SIZE>
impl<N: Counter, const SIZE: usize> SubAssign<N> for Multiset<N, SIZE>
source§fn sub_assign(&mut self, rhs: N)
fn sub_assign(&mut self, rhs: N)
-=
operation. Read moresource§impl<N: Counter, const SIZE: usize> SubAssign for Multiset<N, SIZE>
impl<N: Counter, const SIZE: usize> SubAssign for Multiset<N, SIZE>
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-=
operation. Read more