Skip to main content

Key

Trait Key 

Source
pub trait Key:
    'static
    + Send
    + Sync {
    // Required methods
    fn collect(&self) -> impl AsRef<[u8]>;
    fn into_key(value: &[u8]) -> Result<Self>
       where Self: Sized;
}

Required Methods§

Source

fn collect(&self) -> impl AsRef<[u8]>

Source

fn into_key(value: &[u8]) -> Result<Self>
where Self: Sized,

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Key for u32

Source§

fn collect(&self) -> impl AsRef<[u8]>

Source§

fn into_key(value: &[u8]) -> Result<Self>

Source§

impl Key for u64

Source§

fn collect(&self) -> impl AsRef<[u8]>

Source§

fn into_key(value: &[u8]) -> Result<Self>

Source§

impl<const N: usize> Key for [u8; N]

Source§

fn collect(&self) -> impl AsRef<[u8]>

Source§

fn into_key(value: &[u8]) -> Result<Self>

Implementors§