Skip to main content

KeyDe

Trait KeyDe 

Source
pub trait KeyDe: Sized {
    // Required method
    fn decode_key(bytes: &[u8]) -> Result<Self>;
}
Expand description

A trait for decoding keys.

Required Methods§

Source

fn decode_key(bytes: &[u8]) -> Result<Self>

Decodes a key from a byte slice.

Returns Err when the bytes are invalid. VSDB collections use assert-style unwraps on this internally because data they wrote is always trusted — see module-level trust model.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§