pub struct Min<T> { /* private fields */ }
Expand description
Helper type to ensure to calculate a minimal value
Implementations§
Source§impl<T> Min<T>
impl<T> Min<T>
Sourcepub fn with_initial(initial: T) -> Self
pub fn with_initial(initial: T) -> Self
Create a new instance with an initial value to compare to
Sourcepub fn get_min(&self) -> Option<T>
pub fn get_min(&self) -> Option<T>
Return the minimal value found so far
Returns None
if neither an initial value exists nor update
was called.
Returns Some(T)
if at least one value exists.
Sourcepub fn get_min_extreme(&self) -> Twhere
T: Bounded,
pub fn get_min_extreme(&self) -> Twhere
T: Bounded,
Return the minimal value found so far
This method falls back to the maximal value for type T
, if no other value exists.
Trait Implementations§
Source§impl<T> FromIterator<T> for Min<T>where
T: Ord,
impl<T> FromIterator<T> for Min<T>where
T: Ord,
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<T: Ord> Ord for Min<T>
impl<T: Ord> Ord for Min<T>
Source§impl<T: PartialOrd> PartialOrd for Min<T>
impl<T: PartialOrd> PartialOrd for Min<T>
impl<T: Copy> Copy for Min<T>
impl<T: Eq> Eq for Min<T>
impl<T> StructuralPartialEq for Min<T>
Auto Trait Implementations§
impl<T> Freeze for Min<T>where
T: Freeze,
impl<T> RefUnwindSafe for Min<T>where
T: RefUnwindSafe,
impl<T> Send for Min<T>where
T: Send,
impl<T> Sync for Min<T>where
T: Sync,
impl<T> Unpin for Min<T>where
T: Unpin,
impl<T> UnwindSafe for Min<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more