Decodable

Trait Decodable 

Source
pub trait Decodable: Sized {
    type Error;

    // Required method
    fn decode(buf: &mut Reader<'_>) -> Result<Self, Self::Error>;
}

Required Associated Types§

Required Methods§

Source

fn decode(buf: &mut Reader<'_>) -> Result<Self, Self::Error>

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§

type Error = Error

Source§

fn decode(buf: &mut Reader<'_>) -> Result<Self, Self::Error>

Source§

impl Decodable for i64

Source§

type Error = Error

Source§

fn decode(buf: &mut Reader<'_>) -> Result<Self, Self::Error>

Source§

impl Decodable for u8

Source§

type Error = Error

Source§

fn decode(buf: &mut Reader<'_>) -> Result<Self, Self::Error>

Source§

impl Decodable for u16

Source§

type Error = Error

Source§

fn decode(buf: &mut Reader<'_>) -> Result<Self, Self::Error>

Source§

impl Decodable for u32

Source§

type Error = Error

Source§

fn decode(buf: &mut Reader<'_>) -> Result<Self, Self::Error>

Source§

impl Decodable for u64

Source§

type Error = Error

Source§

fn decode(buf: &mut Reader<'_>) -> Result<Self, Self::Error>

Source§

impl Decodable for String

Source§

type Error = Error

Source§

fn decode(buf: &mut Reader<'_>) -> Result<Self, Self::Error>

Source§

impl Decodable for Bytes

Source§

type Error = Error

Source§

fn decode(buf: &mut Reader<'_>) -> Result<Self, Self::Error>

Source§

impl<T> Decodable for Option<T>
where T: Decodable, T::Error: From<Error>,

Source§

type Error = <T as Decodable>::Error

Source§

fn decode(buf: &mut Reader<'_>) -> Result<Self, Self::Error>
where Self: Sized,

Source§

impl<T> Decodable for Vec<T>
where T: Decodable + 'static, T::Error: From<Error>,

Source§

type Error = <T as Decodable>::Error

Source§

fn decode(buf: &mut Reader<'_>) -> Result<Self, Self::Error>
where Self: Sized,

Source§

impl<T, const LEN: usize> Decodable for ArrayVec<T, LEN>
where T: Decodable + 'static, T::Error: From<Error>,

Source§

type Error = <T as Decodable>::Error

Source§

fn decode(buf: &mut Reader<'_>) -> Result<Self, Self::Error>
where Self: Sized,

Source§

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

Source§

type Error = Error

Source§

fn decode(buf: &mut Reader<'_>) -> Result<Self, Self::Error>

Implementors§