pub trait NumOrd<Other> {
// Required method
fn num_partial_cmp(&self, other: &Other) -> Option<Ordering>;
// Provided methods
fn num_eq(&self, other: &Other) -> bool { ... }
fn num_ne(&self, other: &Other) -> bool { ... }
fn num_lt(&self, other: &Other) -> bool { ... }
fn num_le(&self, other: &Other) -> bool { ... }
fn num_gt(&self, other: &Other) -> bool { ... }
fn num_ge(&self, other: &Other) -> bool { ... }
fn num_cmp(&self, other: &Other) -> Ordering { ... }
}
Expand description
Consistent comparison among different numeric types.
Required Methods§
sourcefn num_partial_cmp(&self, other: &Other) -> Option<Ordering>
fn num_partial_cmp(&self, other: &Other) -> Option<Ordering>
PartialOrd::partial_cmp on different numeric types
Provided Methods§
sourcefn num_eq(&self, other: &Other) -> bool
fn num_eq(&self, other: &Other) -> bool
PartialEq::eq on different numeric types
sourcefn num_ne(&self, other: &Other) -> bool
fn num_ne(&self, other: &Other) -> bool
PartialEq::ne on different numeric types
sourcefn num_lt(&self, other: &Other) -> bool
fn num_lt(&self, other: &Other) -> bool
PartialOrd::lt on different numeric types
sourcefn num_le(&self, other: &Other) -> bool
fn num_le(&self, other: &Other) -> bool
PartialOrd::le on different numeric types
sourcefn num_gt(&self, other: &Other) -> bool
fn num_gt(&self, other: &Other) -> bool
PartialOrd::gt on different numeric types
sourcefn num_ge(&self, other: &Other) -> bool
fn num_ge(&self, other: &Other) -> bool
PartialOrd::ge on different numeric types