Trait minicbor::bytes::DecodeBytes

source ·
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>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

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, 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, const N: usize> DecodeBytes<'b, C> for [u8; N]

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, const N: usize> DecodeBytes<'b, C> for ByteArray<N>