minicbor::bytes

Trait 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>

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.

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>