[][src]Trait sled_extensions::Encoding

pub trait Encoding<T> {
    fn encode(t: &T) -> Result<Vec<u8>>;
fn decode(slice: &[u8]) -> Result<T>; }

The Encoding trait

By implementing this trait, a custom data format can be used to store information in Sled

Required methods

fn encode(t: &T) -> Result<Vec<u8>>

Encoding data to bytes

fn decode(slice: &[u8]) -> Result<T>

Decoding data from bytes

Loading content...

Implementors

impl<T> Encoding<T> for PlainEncoding where
    T: AsRef<[u8]>,
    T: From<&'a [u8]>, 
[src]

Loading content...