Struct capped_multiset::CappedMultiset
[−]
[src]
pub struct CappedMultiset { /* fields omitted */ }
A CappedMultiset
structure is a data structure similar to a multiset with the key distinction
that it supports setting a cap on the values of each element. Once a cap is set, all
operations on the data structure that access an element will return at most the value of the
cap.
Methods
impl CappedMultiset
[src]
fn new(item: Vec<u32>) -> CappedMultiset
Consumes a Vec<u32>
and returns a CappedMultiset
with the same values.
By default, no cap is set on the elements of the multiset
fn sum(&self) -> u32
Compute the sum of all elements of the multiset, honoring the value of the cap.
fn set_cap(&mut self, cap: Option<u32>)
Set a cap on the values of the multiset
Trait Implementations
impl Hash for CappedMultiset
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for CappedMultiset
[src]
impl Eq for CappedMultiset
[src]
impl PartialEq for CappedMultiset
[src]
fn eq(&self, __arg_0: &CappedMultiset) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &CappedMultiset) -> bool
This method tests for !=
.