#[repr(transparent)]pub struct Reverse<T>(pub T);Expand description
A helper struct for reverse ordering.
This struct is a helper to be used with functions like Vec::sort_by_key and
can be used to reverse order a part of a key.
§Examples
Tuple Fields§
§0: TTrait Implementations§
1.19.0 · Source§impl<T: Clone> Clone for Reverse<T>
impl<T: Clone> Clone for Reverse<T>
Source§fn clone(&self) -> Reverse<T>
fn clone(&self) -> Reverse<T>
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Returns a duplicate of the value. Read more
Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Performs copy-assignment from
source. Read more1.19.0 · Source§impl<T: Hash> Hash for Reverse<T>
impl<T: Hash> Hash for Reverse<T>
1.19.0 (const: unstable) · Source§impl<T: Ord> Ord for Reverse<T>
impl<T: Ord> Ord for Reverse<T>
Source§fn cmp(&self, other: &Reverse<T>) -> Ordering
fn cmp(&self, other: &Reverse<T>) -> Ordering
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Compares and returns the maximum of two values. Read more
1.19.0 (const: unstable) · Source§impl<T: PartialEq> PartialEq for Reverse<T>
impl<T: PartialEq> PartialEq for Reverse<T>
1.19.0 (const: unstable) · Source§impl<T: PartialOrd> PartialOrd for Reverse<T>
impl<T: PartialOrd> PartialOrd for Reverse<T>
Source§fn partial_cmp(&self, other: &Reverse<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &Reverse<T>) -> Option<Ordering>
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Source§fn lt(&self, other: &Self) -> bool
fn lt(&self, other: &Self) -> bool
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Source§fn le(&self, other: &Self) -> bool
fn le(&self, other: &Self) -> bool
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
impl<T: Copy> Copy for Reverse<T>
impl<T: Eq> Eq for Reverse<T>
impl<T> StructuralPartialEq for Reverse<T>
Auto Trait Implementations§
impl<T> Freeze for Reverse<T>where
T: Freeze,
impl<T> RefUnwindSafe for Reverse<T>where
T: RefUnwindSafe,
impl<T> Send for Reverse<T>where
T: Send,
impl<T> Sync for Reverse<T>where
T: Sync,
impl<T> Unpin for Reverse<T>where
T: Unpin,
impl<T> UnsafeUnpin for Reverse<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Reverse<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
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Mutably borrows from an owned value. Read more