Trait BytesDecode

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

    // Required method
    fn bytes_decode(bytes: &'a [u8]) -> Result<Self::DItem, BoxedError>;
}
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, BoxedError>

Decode the given bytes as DItem.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

impl BytesDecode<'_> for Unit

impl BytesDecode<'_> for I8

impl BytesDecode<'_> for U8

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

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

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

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

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

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

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

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

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

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

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

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

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