Struct stats::MinMax
[−]
[src]
pub struct MinMax<T> { /* fields omitted */ }A commutative data structure for tracking minimum and maximum values.
This also stores the number of samples.
Methods
impl<T: PartialOrd + Clone> MinMax<T>[src]
fn new() -> MinMax<T>
Create an empty state where min and max values do not exist.
fn add(&mut self, sample: T)
Add a sample to the data.
fn min(&self) -> Option<&T>
Returns the minimum of the data set.
None is returned if and only if the number of samples is 0.
fn max(&self) -> Option<&T>
Returns the maximum of the data set.
None is returned if and only if the number of samples is 0.
fn len(&self) -> usize
Returns the number of data point.
Trait Implementations
impl<T: Clone> Clone for MinMax<T>[src]
fn clone(&self) -> MinMax<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more
impl<T: PartialOrd> Commute for MinMax<T>[src]
fn merge(&mut self, v: MinMax<T>)
Merges the value other into self.
fn consume<I: Iterator<Item = Self>>(&mut self, other: I)
Merges the values in the iterator into self.
impl<T: PartialOrd> Default for MinMax<T>[src]
impl<T: Debug> Debug for MinMax<T>[src]
impl<T: PartialOrd + Clone> FromIterator<T> for MinMax<T>[src]
fn from_iter<I: IntoIterator<Item = T>>(it: I) -> MinMax<T>
Creates a value from an iterator. Read more
impl<T: PartialOrd + Clone> Extend<T> for MinMax<T>[src]
fn extend<I: IntoIterator<Item = T>>(&mut self, it: I)
Extends a collection with the contents of an iterator. Read more