Trait KeyDecodeOwned

Source
pub trait KeyDecodeOwned: for<'a> KeyDecode<'a> {
    // Provided method
    fn decode_from_vec(bytes: Vec<u8>) -> Result<Self, Error>
       where Self: Sized { ... }
}

Provided Methods§

Source

fn decode_from_vec(bytes: Vec<u8>) -> Result<Self, Error>
where Self: Sized,

Decode the key from an owned vector.

A lot of kv query methods return vectors for keys, which some key types might be able to use to more effeciently decode the data.

The default implementation just calls decode

Implementations on Foreign Types§

Source§

impl KeyDecodeOwned for ()

Source§

fn decode_from_vec(_: Vec<u8>) -> Result<Self, Error>
where Self: Sized,

Source§

impl KeyDecodeOwned for Vec<u8>

Source§

fn decode_from_vec(bytes: Vec<u8>) -> Result<Self, Error>

Implementors§