pub trait Key:
Sized
+ Ord
+ Clone
+ Debug
+ Default
+ Max
+ Min {
const SERIALIZED_SIZE: usize;
// Required methods
fn write_to<W: Write>(&self, writer: &mut W) -> Result<usize>;
fn read_from<R: Read>(reader: &mut R) -> Result<Self>;
fn from_bytes(bytes: &[u8]) -> Result<Self>;
}Expand description
Trait defining requirements for keys used in the StaticBTree.
Keys must support ordering (Ord), cloning (Clone), debugging (Debug),
and have a fixed serialized size (SERIALIZED_SIZE). Variable-length types
like String must be adapted (e.g., using fixed-size prefixes) to conform.
Required Associated Constants§
Sourceconst SERIALIZED_SIZE: usize
const SERIALIZED_SIZE: usize
The exact size of the key in bytes when serialized. This is crucial for calculating node sizes and offsets.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".