pub fn user_compare_variant(op: BinOp) -> Option<(&'static str, bool)>Expand description
Map an ordering BinOp (< / <= / > / >=) onto the Ordering
variant name and whether the comparison is an equality (true) or
inequality (false) against it, for lowering a user-Comparable
comparison through compare:
| op | variant | equality |
|---|---|---|
< | "Less" | true |
> | "Greater" | true |
<= | "Greater" | false |
>= | "Less" | false |
a < b ⇒ compare == Less, a <= b ⇒ compare != Greater, etc. Returns
None for any non-ordering operator (the caller only invokes it after
is_user_compare, which already restricts to the four ordering ops).