struct@ Ord
struct@ Ord {
fn less(Self) bool
}Purpose
Method-set constraint Ord.
Required methods
lessfn less(Self) bool- Operation on
Ord: whether this value is strictly less than the other.
#cmpComparison: struct@ Ord and less_*/compare_*. f64: NaN is less than non-NaN; NaN equals NaN.
struct@ Ordstruct@ Ord {
fn less(Self) bool
}Method-set constraint Ord.
less fn less(Self) boolOrd: whether this value is strictly less than the other.(Ord) lessfn less(Self) boolOperation on Ord: whether this value is strictly less than the other.
self SelfSelf instance used by this call (value receiver).other Selfbool — true or false
less_stringpub fn less_string(a string, b string) boolLexicographic string compare (same rules as former sort.str_less). Used when builtin string.less is lowered; also callable directly.
a stringb stringbool — true or false
less_intpub fn less_int(a int, b int) boolLess int.
a intb intbool — true or false
compare_intpub fn compare_int(a int, b int) intCompare int.
a intb intint — negative if less, zero if equal, positive if greater
less_f64pub fn less_f64(a f64, b f64) boolLess f64.
a f64b f64bool — true or false
compare_f64pub fn compare_f64(a f64, b f64) intCompare f64.
a f64b f64int — negative if less, zero if equal, positive if greater
or_intpub fn or_int(a int, b int) int1.22 cmp.Or as two-arg pairs (no generic comparable / variadic).
a intb intint — a value of this type
or_stringpub fn or_string(a &string, b &string) stringOr string.
a &stringb &stringstring — result string
or_f64pub fn or_f64(a f64, b f64) f64Return the first non-zero f64, or 0.0.
a f64b f64f64 — a value of this type
compare_stringpub fn compare_string(a string, b string) intCompare string.
a stringb stringint — negative if less, zero if equal, positive if greater