Enum MinMaxResult
enum MinMaxResult<T>
MinMaxResult is an enum returned by minmax.
See .minmax() for more detail.
Variants
-
NoElements Empty iterator
-
OneElement(T) Iterator with one element, so the minimum and maximum are the same
-
MinMax(T, T) More than one element in the iterator, the first element is not larger than the second
Implementations
impl<T: Clone> MinMaxResult<T>
fn into_option(self: Self) -> Option<(T, T)>into_optioncreates anOptionof type(T, T). The returnedOptionhas variantNoneif and only if theMinMaxResulthas variantNoElements. OtherwiseSome((x, y))is returned wherex <= y. If theMinMaxResulthas variantOneElement(x), performing this operation will make one clone ofx.Examples
use ; let r: = NoElements; assert_eq!; let r = OneElement; assert_eq!; let r = MinMax; assert_eq!;
impl<T> Any for MinMaxResult<T>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for MinMaxResult<T>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for MinMaxResult<T>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for MinMaxResult<T>
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> Freeze for MinMaxResult<T>
impl<T> From for MinMaxResult<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> RefUnwindSafe for MinMaxResult<T>
impl<T> Send for MinMaxResult<T>
impl<T> StructuralPartialEq for MinMaxResult<T>
impl<T> Sync for MinMaxResult<T>
impl<T> ToOwned for MinMaxResult<T>
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T> Unpin for MinMaxResult<T>
impl<T> UnsafeUnpin for MinMaxResult<T>
impl<T> UnwindSafe for MinMaxResult<T>
impl<T, U> Into for MinMaxResult<T>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for MinMaxResult<T>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for MinMaxResult<T>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T: $crate::clone::Clone> Clone for MinMaxResult<T>
fn clone(self: &Self) -> MinMaxResult<T>
impl<T: $crate::cmp::Eq> Eq for MinMaxResult<T>
impl<T: $crate::cmp::PartialEq> PartialEq for MinMaxResult<T>
fn eq(self: &Self, other: &MinMaxResult<T>) -> bool
impl<T: $crate::fmt::Debug> Debug for MinMaxResult<T>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result