pub trait Comparator {
// Required method
fn compare(a: &[u8], b: &[u8]) -> Ordering;
}
Expand description
Define a custom key comparison function for a database.
The comparison function is called whenever it is necessary to compare a key specified by the application with a key currently stored in the database. If no comparison function is specified, and no special key flags were specified, the keys are compared lexically, with shorter keys collating before longer keys.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.