[][src]Struct stats::MinMax

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]

pub fn new() -> MinMax<T>[src]

Create an empty state where min and max values do not exist.

pub fn add(&mut self, sample: T)[src]

Add a sample to the data.

pub fn min(&self) -> Option<&T>[src]

Returns the minimum of the data set.

None is returned if and only if the number of samples is 0.

pub fn max(&self) -> Option<&T>[src]

Returns the maximum of the data set.

None is returned if and only if the number of samples is 0.

pub fn len(&self) -> usize[src]

Returns the number of data point.

Trait Implementations

impl<T: Clone> Clone for MinMax<T>[src]

impl<T: PartialOrd> Commute for MinMax<T>[src]

impl<T: Debug> Debug for MinMax<T>[src]

impl<T: PartialOrd> Default for MinMax<T>[src]

impl<T: PartialOrd + Clone> Extend<T> for MinMax<T>[src]

impl<T: PartialOrd + Clone> FromIterator<T> for MinMax<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for MinMax<T> where
    T: RefUnwindSafe

impl<T> Send for MinMax<T> where
    T: Send

impl<T> Sync for MinMax<T> where
    T: Sync

impl<T> Unpin for MinMax<T> where
    T: Unpin

impl<T> UnwindSafe for MinMax<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.