pub struct Max<T>(pub T);
Expand description
Semigroup over the Maximum of T if T implements std::cmp::Ord.
assert_eq!(Max(10), Max(10).combine(Max(5)));
Tuple Fields§
§0: T
Trait Implementations§
Source§impl<T: Ord> Ord for Max<T>
impl<T: Ord> Ord for Max<T>
Source§impl<T: PartialOrd> PartialOrd<T> for Max<T>
impl<T: PartialOrd> PartialOrd<T> for Max<T>
Source§impl<T: PartialOrd> PartialOrd for Max<T>
impl<T: PartialOrd> PartialOrd for Max<T>
impl<T: Copy> Copy for Max<T>
impl<T: Eq> Eq for Max<T>
impl<T> StructuralPartialEq for Max<T>
Auto Trait Implementations§
impl<T> Freeze for Max<T>where
T: Freeze,
impl<T> RefUnwindSafe for Max<T>where
T: RefUnwindSafe,
impl<T> Send for Max<T>where
T: Send,
impl<T> Sync for Max<T>where
T: Sync,
impl<T> Unpin for Max<T>where
T: Unpin,
impl<T> UnwindSafe for Max<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