Decode

Trait Decode 

Source
pub trait Decode<'buf>: Sized {
    // Required method
    fn decode(r: &mut Reader<'buf>) -> Option<Self>;
}
Expand description

A trait for decoding values from a buffer.

§Note

This trait is intended for low-level implementations. Use the decoder for convenient decoding of byte sequences.

Required Methods§

Source

fn decode(r: &mut Reader<'buf>) -> 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 Decode<'_> for u8

Source§

fn decode(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Decode<'_> for ()

Source§

fn decode(_: &mut Reader<'_>) -> Option<Self>

Source§

impl<'buf, const N: usize> Decode<'buf> for &'buf [u8; N]

Source§

fn decode(r: &mut Reader<'buf>) -> Option<Self>

Source§

impl<'buf, const N: usize> Decode<'buf> for [u8; N]

Source§

fn decode(r: &mut Reader<'buf>) -> Option<Self>

Implementors§