Trait bonsaidb_core::key::Key
source · [−]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
fn first_value() -> Result<Self, NextValueError>
fn first_value() -> Result<Self, NextValueError>
Return the first value in sequence for this type. Not all types implement this.
fn next_value(&self) -> Result<Self, NextValueError>
fn next_value(&self) -> Result<Self, NextValueError>
Return the next value in sequence for this type. Not all types implement this. Instead of wrapping/overflowing, None should be returned.