pub trait ToTotalOrd {
type TotalOrdItem: Hash + Eq;
type SourceItem;
// Required methods
fn to_total_ord(&self) -> Self::TotalOrdItem;
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem;
}
Expand description
This elides creating a TotalOrdWrap
for types that don’t need it.
Required Associated Types§
type TotalOrdItem: Hash + Eq
type SourceItem
Required Methods§
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl ToTotalOrd for bool
impl ToTotalOrd for bool
type TotalOrdItem = bool
type SourceItem = bool
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl ToTotalOrd for char
impl ToTotalOrd for char
type TotalOrdItem = char
type SourceItem = char
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl ToTotalOrd for f32
impl ToTotalOrd for f32
type TotalOrdItem = TotalOrdWrap<f32>
type SourceItem = f32
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl ToTotalOrd for f64
impl ToTotalOrd for f64
type TotalOrdItem = TotalOrdWrap<f64>
type SourceItem = f64
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl ToTotalOrd for i8
impl ToTotalOrd for i8
type TotalOrdItem = i8
type SourceItem = i8
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl ToTotalOrd for i16
impl ToTotalOrd for i16
type TotalOrdItem = i16
type SourceItem = i16
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl ToTotalOrd for i32
impl ToTotalOrd for i32
type TotalOrdItem = i32
type SourceItem = i32
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl ToTotalOrd for i64
impl ToTotalOrd for i64
type TotalOrdItem = i64
type SourceItem = i64
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl ToTotalOrd for i128
impl ToTotalOrd for i128
type TotalOrdItem = i128
type SourceItem = i128
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl ToTotalOrd for isize
impl ToTotalOrd for isize
type TotalOrdItem = isize
type SourceItem = isize
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl ToTotalOrd for u8
impl ToTotalOrd for u8
type TotalOrdItem = u8
type SourceItem = u8
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl ToTotalOrd for u16
impl ToTotalOrd for u16
type TotalOrdItem = u16
type SourceItem = u16
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl ToTotalOrd for u32
impl ToTotalOrd for u32
type TotalOrdItem = u32
type SourceItem = u32
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl ToTotalOrd for u64
impl ToTotalOrd for u64
type TotalOrdItem = u64
type SourceItem = u64
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl ToTotalOrd for u128
impl ToTotalOrd for u128
type TotalOrdItem = u128
type SourceItem = u128
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl ToTotalOrd for usize
impl ToTotalOrd for usize
type TotalOrdItem = usize
type SourceItem = usize
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl ToTotalOrd for String
impl ToTotalOrd for String
type TotalOrdItem = String
type SourceItem = String
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl<'a> ToTotalOrd for &'a str
impl<'a> ToTotalOrd for &'a str
type TotalOrdItem = &'a str
type SourceItem = &'a str
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl<'a> ToTotalOrd for &'a [u8]
impl<'a> ToTotalOrd for &'a [u8]
type TotalOrdItem = &'a [u8]
type SourceItem = &'a [u8]
fn to_total_ord(&self) -> Self::TotalOrdItem
fn peel_total_ord(ord_item: Self::TotalOrdItem) -> Self::SourceItem
Source§impl<T: Copy + TotalEq + TotalHash> ToTotalOrd for Option<T>
This is safe without needing to map the option value to TotalOrdWrap, since
for example:
TotalOrdWrap<Option<T>>
implements Eq + Hash
, iff:
Option<T>
implements TotalEq + TotalHash
, iff:
T
implements TotalEq + TotalHash
impl<T: Copy + TotalEq + TotalHash> ToTotalOrd for Option<T>
This is safe without needing to map the option value to TotalOrdWrap, since
for example:
TotalOrdWrap<Option<T>>
implements Eq + Hash
, iff:
Option<T>
implements TotalEq + TotalHash
, iff:
T
implements TotalEq + TotalHash