pub trait Ord { fn lt(&self, other: &Self) -> bool; fn le(&self, other: &Self) -> bool { ... } fn gt(&self, other: &Self) -> bool { ... } fn ge(&self, other: &Self) -> bool { ... } }
Trait for values that can be compared for a sort-order.
Ord only requires implementation of the lt
method,
with the others generated from default implementations.
However it remains possible to implement the others separately, for compatibility with floating-point NaN semantics (cf. IEEE 754-2008 section 5.11).
fn lt(&self, other: &Self) -> bool
fn le(&self, other: &Self) -> bool
fn gt(&self, other: &Self) -> bool
fn ge(&self, other: &Self) -> bool
NonCopyable
Option<T>
Ordering
SendStr
Ascii
impl Ord for int
impl Ord for i8
impl Ord for i16
impl Ord for i32
impl Ord for i64
impl Ord for uint
impl Ord for u8
impl Ord for u16
impl Ord for u32
impl Ord for u64
impl Ord for float
impl Ord for f32
impl Ord for f64
impl Ord for ()
impl Ord for bool
impl Ord for char
impl<A: Ord + Eq> Ord for (A)
impl<A: Ord + Eq, B: Ord + Eq> Ord for (A, B)
impl<A: Ord + Eq, B: Ord + Eq, C: Ord + Eq> Ord for (A, B, C)
impl<A: Ord + Eq, B: Ord + Eq, C: Ord + Eq, D: Ord + Eq> Ord for (A, B, C, D)
impl<A: Ord + Eq, B: Ord + Eq, C: Ord + Eq, D: Ord + Eq, E: Ord + Eq> Ord for (A, B, C, D, E)
impl<A: Ord + Eq, B: Ord + Eq, C: Ord + Eq, D: Ord + Eq, E: Ord + Eq, F: Ord + Eq> Ord for (A, B, C, D, E, F)
impl<A: Ord + Eq, B: Ord + Eq, C: Ord + Eq, D: Ord + Eq, E: Ord + Eq, F: Ord + Eq, G: Ord + Eq> Ord for (A, B, C, D, E, F, G)
impl<A: Ord + Eq, B: Ord + Eq, C: Ord + Eq, D: Ord + Eq, E: Ord + Eq, F: Ord + Eq, G: Ord + Eq, H: Ord + Eq> Ord for (A, B, C, D, E, F, G, H)
impl<A: Ord + Eq, B: Ord + Eq, C: Ord + Eq, D: Ord + Eq, E: Ord + Eq, F: Ord + Eq, G: Ord + Eq, H: Ord + Eq, I: Ord + Eq> Ord for (A, B, C, D, E, F, G, H, I)
impl<A: Ord + Eq, B: Ord + Eq, C: Ord + Eq, D: Ord + Eq, E: Ord + Eq, F: Ord + Eq, G: Ord + Eq, H: Ord + Eq, I: Ord + Eq, J: Ord + Eq> Ord for (A, B, C, D, E, F, G, H, I, J)
impl<A: Ord + Eq, B: Ord + Eq, C: Ord + Eq, D: Ord + Eq, E: Ord + Eq, F: Ord + Eq, G: Ord + Eq, H: Ord + Eq, I: Ord + Eq, J: Ord + Eq, K: Ord + Eq> Ord for (A, B, C, D, E, F, G, H, I, J, K)
impl<A: Ord + Eq, B: Ord + Eq, C: Ord + Eq, D: Ord + Eq, E: Ord + Eq, F: Ord + Eq, G: Ord + Eq, H: Ord + Eq, I: Ord + Eq, J: Ord + Eq, K: Ord + Eq, L: Ord + Eq> Ord for (A, B, C, D, E, F, G, H, I, J, K, L)
impl<'self, T: Eq + Ord> Ord for &'self [T]
impl<T: Eq + Ord> Ord for ~[T]
impl<T: Eq + Ord> Ord for @[T]
impl<'self> Ord for &'self str
impl Ord for ~str
impl Ord for @str
impl<T> Ord for *T
impl<T> Ord for *mut T
impl<T: Ord> Ord for ~T
impl<T: Ord> Ord for @T
impl<T: Ord> Ord for @mut T
impl<'self, T: Ord> Ord for &'self T
Prefix searches with a type followed by a colon (e.g.
fn:
) to restrict the search to a given type.
Accepted types are: fn
, mod
,
struct
(or str
), enum
,
trait
, typedef
(or
tdef
).