Trait minicbor::bytes::DecodeBytes

source ·
pub trait DecodeBytes<'b>: Sized {
    // Required method
    fn decode_bytes(d: &mut Decoder<'b>) -> 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>) -> 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> DecodeBytes<'b> for &'a [u8]

source§

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

source§

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

source§

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

source§

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

source§

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

source§

fn nil() -> Option<Self>

source§

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

source§

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

Implementors§

source§

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

source§

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

source§

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