Trait leveldb::database::comparator::Comparator [-] [+] [src]

pub trait Comparator {
    type K: Key;

    fn name(&self) -> *const u8;
    fn compare(&self, a: &Self::K, b: &Self::K) -> Ordering;

    fn null() -> bool { ... }
}

A comparator has two important functions:

Associated Types

type K: Key

The type that the comparator compares.

Required Methods

fn name(&self) -> *const u8

Return the name of the Comparator

fn compare(&self, a: &Self::K, b: &Self::K) -> Ordering

compare two keys. This must implement a total ordering.

Provided Methods

fn null() -> bool

whether the comparator is the DefaultComparator

Implementors