Struct frequency_ordermap::OrderMapFrequency [] [src]

pub struct OrderMapFrequency<T, N = usize, S = FnvBuildHasher> where
    T: Hash + Eq,
    N: Num,
    S: BuildHasher
{ /* fields omitted */ }

A frequency counter backed by an OrderMap

Methods

impl<T, N, S> OrderMapFrequency<T, N, S> where
    T: Eq + Hash,
    N: Num,
    S: BuildHasher + Default
[src]

Creates an empty OrderMapFrequency, a frequency counter backed by a OrderMap. Does not allocate.

Creates an empty OrderMapFrequency, a frequency counter backed by a OrderMap with the specified capacity.

The hash map will be able to hold at least capacity elements without reallocating. If capacity is 0, the hash map will not allocate. ```

impl<T, N, S> OrderMapFrequency<T, N, S> where
    T: Eq + Hash,
    N: Num,
    S: BuildHasher
[src]

Creates an empty OrderMapFrequency, a frequency counter backed by a OrderMap with the specified capacity, using hasher to hash the keys.

The hash map will be able to hold at least capacity elements without reallocating. If capacity is 0, the hash map will not allocate.

Returns the number of elements that have been counted.

Returns true if the counter contains no elements.

Reserves capacity for at least additional more elements to be inserted in the OrderMap backing this frequency counter. The collection may reserve more space to avoid frequent reallocations.

Panics

Panics if the new allocation size overflows usize.

Trait Implementations

impl<'t, T, N, S> Frequency<'t, T> for OrderMapFrequency<T, N, S> where
    T: 't + Eq + Hash,
    N: 't + Num + Clone,
    S: 't + BuildHasher
[src]

The type used to record counts.

The type of an iterator over item-count pairs.

The type of an iterator over items.

The type of an iterator over counts.

Returns the count of an item.

Increments the count for an item.

An iterator visiting all key-value pairs. Iterator element type is (&'t T, &'t usize). Read more

An iterator visiting all keys in arbitrary order. Iterator element type is &'t T. Read more

An iterator visiting all counts in arbitrary order. Iterator element type is &'t usize. Read more

impl<T, N, S> Default for OrderMapFrequency<T, N, S> where
    T: Eq + Hash,
    N: Num,
    S: BuildHasher + Default
[src]

Creates an empty OrderMapFrequency<T, V, S>, a frequency counter backed by a OrderMap with the Default value for the hasher.

impl<T, N, S> Extend<T> for OrderMapFrequency<T, N, S> where
    T: Eq + Hash,
    N: Num + Clone,
    S: BuildHasher
[src]

Extends a collection with the contents of an iterator. Read more

impl<T, N, S> FromIterator<T> for OrderMapFrequency<T, N, S> where
    T: Eq + Hash,
    N: Num + Clone,
    S: BuildHasher + Default
[src]

Creates a value from an iterator. Read more

impl<'t, T, N, S> IntoIterator for &'t OrderMapFrequency<T, N, S> where
    T: 't + Eq + Hash,
    N: 't + Num + Clone,
    S: 't + BuildHasher
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

impl<T, N, S> AsRef<OrderMap<T, N, S>> for OrderMapFrequency<T, N, S> where
    T: Eq + Hash,
    N: Num,
    S: BuildHasher
[src]

Performs the conversion.

impl<T, N, S> AsMut<OrderMap<T, N, S>> for OrderMapFrequency<T, N, S> where
    T: Eq + Hash,
    N: Num,
    S: BuildHasher
[src]

Performs the conversion.