Protocol std::cmp::Comparable

protocol Comparable<Self> { ... }
Self: Equatable<Self>

Types that have a total order.

Types that implement this protocol can be compared using the <, <=, > and >= operators.

Method compare must be implemented, other methods can be mixed in. This includes the default implementations for equals and not_equals of the Equatable protocol.

Example

See also lex_compare for a convenient way to implement the compare method.

Required methods

Provided methods