pub trait KeyEncoding<'k, K>: Send + Syncwhere
    K: Key<'k>,
{ type Error: AnyError; const LENGTH: Option<usize>; fn as_ord_bytes(&'k self) -> Result<Cow<'k, [u8]>, Self::Error>; }
Expand description

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

Required Associated Types§

The error type that can be produced by either serialization or deserialization.

Required Associated Constants§

The size of the key, if constant. If this type doesn’t produce the same number of bytes for each value, this should be None.

Required Methods§

Convert self into a Cow<[u8]> containing bytes that are able to be compared via memcmp in a way that is comptaible with its own Ord implementation.

Implementations on Foreign Types§

Implementors§