Trait Decodable

Source
pub trait Decodable: Sized {
    // Required method
    fn decode(buf: &mut &[u8]) -> Result<Self, DecodeError>;
}

Required Methods§

Source

fn decode(buf: &mut &[u8]) -> Result<Self, DecodeError>

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 Decodable for bool

Source§

fn decode(buf: &mut &[u8]) -> Result<Self, DecodeError>

Source§

impl Decodable for u8

Source§

fn decode(buf: &mut &[u8]) -> Result<Self, DecodeError>

Source§

impl Decodable for u16

Source§

fn decode(buf: &mut &[u8]) -> Result<Self, DecodeError>

Source§

impl Decodable for u32

Source§

fn decode(buf: &mut &[u8]) -> Result<Self, DecodeError>

Source§

impl Decodable for u64

Source§

fn decode(buf: &mut &[u8]) -> Result<Self, DecodeError>

Source§

impl Decodable for u128

Source§

fn decode(buf: &mut &[u8]) -> Result<Self, DecodeError>

Source§

impl Decodable for usize

Source§

fn decode(buf: &mut &[u8]) -> Result<Self, DecodeError>

Source§

impl Decodable for Bytes

Source§

fn decode(buf: &mut &[u8]) -> Result<Self, DecodeError>

Source§

impl Decodable for BytesMut

Source§

fn decode(from: &mut &[u8]) -> Result<Self, DecodeError>

Source§

impl<const N: usize> Decodable for [u8; N]

Source§

fn decode(from: &mut &[u8]) -> Result<Self, DecodeError>

Implementors§