Trait frequency::Frequency
[−]
[src]
pub trait Frequency<'t, T> where
&'t Self: 't + IntoIterator,
T: 't + Eq, { type N: Num; type Iter: Iterator<Item = (&'t T, &'t Self::N)>; type Items: Iterator<Item = &'t T>; type Counts: Iterator<Item = &'t Self::N>; fn count(&self, value: &T) -> Self::N; fn increment(&mut self, value: T); fn iter(&'t self) -> Self::Iter; fn items(&'t self) -> Self::Items; fn counts(&'t self) -> Self::Counts; }
Associated Types
type N: Num
The type used to record counts.
type Iter: Iterator<Item = (&'t T, &'t Self::N)>
The type of an iterator over item-count pairs.
type Items: Iterator<Item = &'t T>
The type of an iterator over items.
type Counts: Iterator<Item = &'t Self::N>
The type of an iterator over counts.
Required Methods
fn count(&self, value: &T) -> Self::N
Returns the count of an item.
fn increment(&mut self, value: T)
Increments the count for an item.
fn iter(&'t self) -> Self::Iter
An iterator visiting all key-value pairs.
Iterator element type is (&'t T, &'t usize)
.
fn items(&'t self) -> Self::Items
An iterator visiting all keys in arbitrary order.
Iterator element type is &'t T
.
fn counts(&'t self) -> Self::Counts
An iterator visiting all counts in arbitrary order.
Iterator element type is &'t usize
.