pub enum DefaultComparator {}
Expand description
A representation of LMDB’s default comparator behavior.
This enum is used to indicate the absence of a custom comparator for an LMDB
database instance. When a Database
is created or opened with
DefaultComparator
, it signifies that the comparator should not be explicitly
set via ffi::mdb_set_compare
. Consequently, the database
instance utilizes LMDB’s built-in default comparator, which inherently performs
lexicographic comparison of keys.
This comparator’s lexicographic implementation is employed in scenarios involving
prefix iterators. Specifically, methods other than Comparator::compare
are utilized
to determine the lexicographic successors and predecessors of byte sequences, which
is essential for these iterators’ operation.
When a custom comparator is provided, the wrapper is responsible for setting
it with the ffi::mdb_set_compare
function, which overrides the default comparison
behavior of LMDB with the user-defined logic.
Trait Implementations§
Source§impl LexicographicComparator for DefaultComparator
impl LexicographicComparator for DefaultComparator
Source§fn compare_elem(a: u8, b: u8) -> Ordering
fn compare_elem(a: u8, b: u8) -> Ordering
Comparator::compare
by definition of lexicographic ordering. Read moreSource§fn successor(elem: u8) -> Option<u8>
fn successor(elem: u8) -> Option<u8>
elem
to its immediate lexicographic successor, if possible.
Returns None
if elem
is already at its maximum value with respect to the
lexicographic order defined by this comparator.Auto Trait Implementations§
impl Freeze for DefaultComparator
impl RefUnwindSafe for DefaultComparator
impl Send for DefaultComparator
impl Sync for DefaultComparator
impl Unpin for DefaultComparator
impl UnwindSafe for DefaultComparator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<C> Comparator for Cwhere
C: LexicographicComparator,
impl<C> Comparator for Cwhere
C: LexicographicComparator,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 0 bytes (uninhabited)