Trait heed::BytesDecode

source ·
pub trait BytesDecode<'a> {
    type DItem: 'a;

    // Required method
    fn bytes_decode(
        bytes: &'a [u8]
    ) -> Result<Self::DItem, Box<dyn Error + Sync + Send>>;
}
Expand description

A trait that represents a decoding structure.

Required Associated Types§

source

type DItem: 'a

The type to decode.

Required Methods§

source

fn bytes_decode( bytes: &'a [u8] ) -> Result<Self::DItem, Box<dyn Error + Sync + Send>>

Decode the given bytes as DItem.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl BytesDecode<'_> for DecodeIgnore

§

type DItem = ()

source§

fn bytes_decode( _bytes: &[u8] ) -> Result<<DecodeIgnore as BytesDecode<'_>>::DItem, Box<dyn Error + Sync + Send>>

source§

impl BytesDecode<'_> for Unit

§

type DItem = ()

source§

fn bytes_decode( bytes: &[u8] ) -> Result<<Unit as BytesDecode<'_>>::DItem, Box<dyn Error + Sync + Send>>

source§

impl BytesDecode<'_> for I8

§

type DItem = i8

source§

fn bytes_decode( bytes: &[u8] ) -> Result<<I8 as BytesDecode<'_>>::DItem, Box<dyn Error + Sync + Send>>

source§

impl BytesDecode<'_> for U8

§

type DItem = u8

source§

fn bytes_decode( bytes: &[u8] ) -> Result<<U8 as BytesDecode<'_>>::DItem, Box<dyn Error + Sync + Send>>

source§

impl<'a> BytesDecode<'a> for Bytes

§

type DItem = &'a [u8]

source§

fn bytes_decode( bytes: &'a [u8] ) -> Result<<Bytes as BytesDecode<'a>>::DItem, Box<dyn Error + Sync + Send>>

source§

impl<'a> BytesDecode<'a> for Str

§

type DItem = &'a str

source§

fn bytes_decode( bytes: &'a [u8] ) -> Result<<Str as BytesDecode<'a>>::DItem, Box<dyn Error + Sync + Send>>

source§

impl<'a, C> BytesDecode<'a> for LazyDecode<C>
where C: 'static,

§

type DItem = Lazy<'a, C>

source§

fn bytes_decode( bytes: &'a [u8] ) -> Result<<LazyDecode<C> as BytesDecode<'a>>::DItem, Box<dyn Error + Sync + Send>>

source§

impl<'a, T> BytesDecode<'a> for SerdeBincode<T>
where T: 'a + Deserialize<'a>,

§

type DItem = T

source§

fn bytes_decode( bytes: &'a [u8] ) -> Result<<SerdeBincode<T> as BytesDecode<'a>>::DItem, Box<dyn Error + Sync + Send>>

source§

impl<'a, T> BytesDecode<'a> for SerdeJson<T>
where T: 'a + Deserialize<'a>,

§

type DItem = T

source§

fn bytes_decode( bytes: &'a [u8] ) -> Result<<SerdeJson<T> as BytesDecode<'a>>::DItem, Box<dyn Error + Sync + Send>>

source§

impl<O> BytesDecode<'_> for I16<O>
where O: ByteOrder,

§

type DItem = i16

source§

fn bytes_decode( bytes: &[u8] ) -> Result<<I16<O> as BytesDecode<'_>>::DItem, Box<dyn Error + Sync + Send>>

source§

impl<O> BytesDecode<'_> for I32<O>
where O: ByteOrder,

§

type DItem = i32

source§

fn bytes_decode( bytes: &[u8] ) -> Result<<I32<O> as BytesDecode<'_>>::DItem, Box<dyn Error + Sync + Send>>

source§

impl<O> BytesDecode<'_> for I64<O>
where O: ByteOrder,

§

type DItem = i64

source§

fn bytes_decode( bytes: &[u8] ) -> Result<<I64<O> as BytesDecode<'_>>::DItem, Box<dyn Error + Sync + Send>>

source§

impl<O> BytesDecode<'_> for I128<O>
where O: ByteOrder,

§

type DItem = i128

source§

fn bytes_decode( bytes: &[u8] ) -> Result<<I128<O> as BytesDecode<'_>>::DItem, Box<dyn Error + Sync + Send>>

source§

impl<O> BytesDecode<'_> for U16<O>
where O: ByteOrder,

§

type DItem = u16

source§

fn bytes_decode( bytes: &[u8] ) -> Result<<U16<O> as BytesDecode<'_>>::DItem, Box<dyn Error + Sync + Send>>

source§

impl<O> BytesDecode<'_> for U32<O>
where O: ByteOrder,

§

type DItem = u32

source§

fn bytes_decode( bytes: &[u8] ) -> Result<<U32<O> as BytesDecode<'_>>::DItem, Box<dyn Error + Sync + Send>>

source§

impl<O> BytesDecode<'_> for U64<O>
where O: ByteOrder,

§

type DItem = u64

source§

fn bytes_decode( bytes: &[u8] ) -> Result<<U64<O> as BytesDecode<'_>>::DItem, Box<dyn Error + Sync + Send>>

source§

impl<O> BytesDecode<'_> for U128<O>
where O: ByteOrder,

§

type DItem = u128

source§

fn bytes_decode( bytes: &[u8] ) -> Result<<U128<O> as BytesDecode<'_>>::DItem, Box<dyn Error + Sync + Send>>

Implementors§