pub trait Comparable: 'static {
// Required methods
unsafe fn equal(&self, other: *const u8) -> bool;
unsafe fn less_than(&self, other: *const u8) -> bool;
unsafe fn compare(&self, other: *const u8) -> Ordering;
}Expand description
An object-safe verson of comparison traits.
Traits like Eq and Ord are not object-safe since they take
a reference to Self as the second argument. This trait is an
object-safe (but runtime-unsafe) version of Eq and Ord , which
takes the second argument as a *const u8. It is meant to only be
used inside the (private) derive_comparison_traits macro to derive
Ord and Eq for trait objects.