Trait bonsaidb::core::key::Key[][src]

pub trait Key<'k>: KeyEncoding<'k, Self> + Clone + Debug + Send + Sync {
    fn from_ord_bytes(bytes: &'k [u8]) -> Result<Self, Self::Error>;

    fn first_value() -> Result<Self, NextValueError> { ... }
fn next_value(&self) -> Result<Self, NextValueError> { ... } }
Expand description

A trait that enables a type to convert itself into a memcmp-compatible sequence of bytes.

Required methods

Deserialize a sequence of bytes previously encoded with KeyEncoding::as_ord_bytes.

Provided methods

Return the first value in sequence for this type. Not all types implement this.

Return the next value in sequence for this type. Not all types implement this. Instead of wrapping/overflowing, None should be returned.

Implementations on Foreign Types

Implementors