[−][src]Struct stats::MinMax
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]
fn merge(&mut self, v: MinMax<T>)
[src]
fn consume<I: Iterator<Item = Self>>(&mut self, other: I)
[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]
fn extend<I: IntoIterator<Item = T>>(&mut self, it: I)
[src]
impl<T: PartialOrd + Clone> FromIterator<T> for MinMax<T>
[src]
fn from_iter<I: IntoIterator<Item = T>>(it: I) -> MinMax<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for MinMax<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for MinMax<T> where
T: Send,
T: Send,
impl<T> Sync for MinMax<T> where
T: Sync,
T: Sync,
impl<T> Unpin for MinMax<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for MinMax<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,