Trait sstable::Cmp

source ·
pub trait Cmp: Sync + Send {
    // Required methods
    fn cmp(&self, _: &[u8], _: &[u8]) -> Ordering;
    fn find_shortest_sep(&self, _: &[u8], _: &[u8]) -> Vec<u8>;
    fn find_short_succ(&self, _: &[u8]) -> Vec<u8>;
    fn id(&self) -> &'static str;
}
Expand description

Comparator trait, supporting types that can be nested (i.e., add additional functionality on top of an inner comparator)

Required Methods§

source

fn cmp(&self, _: &[u8], _: &[u8]) -> Ordering

Compare to byte strings, bytewise.

source

fn find_shortest_sep(&self, _: &[u8], _: &[u8]) -> Vec<u8>

Return the shortest byte string that compares “Greater” to the first argument and “Less” to the second one.

source

fn find_short_succ(&self, _: &[u8]) -> Vec<u8>

Return the shortest byte string that compares “Greater” to the argument.

source

fn id(&self) -> &'static str

A unique identifier for a comparator. A comparator wrapper (like InternalKeyCmp) may return the id of its inner comparator.

Implementors§