pub trait DecodeBytes<'b, C>: Sized {
    // Required method
    fn decode_bytes(d: &mut Decoder<'b>, ctx: &mut C) -> Result<Self, Error>;

    // Provided method
    fn nil() -> Option<Self> { ... }
}
Expand description

Like Decode but specific for decoding from byte slices.

Required Methods§

source

fn decode_bytes(d: &mut Decoder<'b>, ctx: &mut C) -> Result<Self, Error>

Provided Methods§

source

fn nil() -> Option<Self>

Implementations on Foreign Types§

source§

impl<'b, C, const N: usize> DecodeBytes<'b, C> for [u8; N]

source§

fn decode_bytes(d: &mut Decoder<'b>, ctx: &mut C) -> Result<Self, Error>

source§

impl<'a, 'b: 'a, C> DecodeBytes<'b, C> for &'a [u8]

source§

fn decode_bytes(d: &mut Decoder<'b>, _: &mut C) -> Result<Self, Error>

source§

impl<'b, C> DecodeBytes<'b, C> for Vec<u8>

source§

fn decode_bytes(d: &mut Decoder<'b>, _: &mut C) -> Result<Self, Error>

source§

impl<'b, C, T: DecodeBytes<'b, C>> DecodeBytes<'b, C> for Option<T>

source§

fn decode_bytes(d: &mut Decoder<'b>, ctx: &mut C) -> Result<Self, Error>

source§

fn nil() -> Option<Self>

source§

impl<'b, C> DecodeBytes<'b, C> for Cow<'_, [u8]>

source§

fn decode_bytes(d: &mut Decoder<'b>, ctx: &mut C) -> Result<Self, Error>

Implementors§

source§

impl<'a, 'b: 'a, C> DecodeBytes<'b, C> for &'a ByteSlice

source§

impl<'b, C> DecodeBytes<'b, C> for ByteVec

source§

impl<'b, C, const N: usize> DecodeBytes<'b, C> for ByteArray<N>