Trait exonum_leveldb::database::comparator::Comparator
[−]
[src]
pub trait Comparator { fn name(&self) -> *const c_char; fn compare(&self, a: &[u8], b: &[u8]) -> Ordering; fn null() -> bool { ... } }
A comparator has two important functions:
- the name function returns a fixed name to detect errors when opening databases with a different name
- The comparison implementation
Required Methods
fn name(&self) -> *const c_char
Return the name of the Comparator
fn compare(&self, a: &[u8], b: &[u8]) -> Ordering
compare two keys. This must implement a total ordering.
Provided Methods
Implementors
impl Comparator for OrdComparator