pub trait KeyEncode {
// Required method
fn encode_into(&self, out: &mut Vec<u8>);
// Provided method
fn encode(&self) -> Vec<u8> ⓘ { ... }
}Expand description
A type that can be encoded into an order-preserving byte key.
Implementors MUST satisfy the ordering law a < b ⟺ encode(a) < encode(b)
and MUST produce a self-delimiting encoding (so tuples compose). Both
properties are checked by the proptests in this module for every built-in.
Required Methods§
Sourcefn encode_into(&self, out: &mut Vec<u8>)
fn encode_into(&self, out: &mut Vec<u8>)
Append this value’s order-preserving encoding to out.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".