Skip to main content

Decode

Trait Decode 

Source
pub trait Decode<Ctx = ()>: Sized
where Self::Error: From<Error>,
{ type Error; // Required method fn decode(r: &mut Reader<'_, Ctx>) -> Result<Self, Self::Error>; }
Expand description

A trait for types that can be decoded from a Reader.

Required Associated Types§

Required Methods§

Source

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

Decodes a value of this type from the given reader.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<Ctx, T, const N: usize> Decode<Ctx> for [T; N]
where T: Decode<Ctx>,

Source§

type Error = <T as Decode<Ctx>>::Error

Source§

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

Source§

impl<Ctx> Decode<Ctx> for bool

Source§

type Error = Error

Source§

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

Source§

impl<Ctx> Decode<Ctx> for f32

Source§

type Error = Error

Source§

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

Source§

impl<Ctx> Decode<Ctx> for f64

Source§

type Error = Error

Source§

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

Source§

impl<Ctx> Decode<Ctx> for i8

Source§

type Error = Error

Source§

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

Source§

impl<Ctx> Decode<Ctx> for i16

Source§

type Error = Error

Source§

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

Source§

impl<Ctx> Decode<Ctx> for i32

Source§

type Error = Error

Source§

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

Source§

impl<Ctx> Decode<Ctx> for i64

Source§

type Error = Error

Source§

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

Source§

impl<Ctx> Decode<Ctx> for i128

Source§

type Error = Error

Source§

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

Source§

impl<Ctx> Decode<Ctx> for isize

Source§

type Error = Error

Source§

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

Source§

impl<Ctx> Decode<Ctx> for u8

Source§

type Error = Error

Source§

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

Source§

impl<Ctx> Decode<Ctx> for u16

Source§

type Error = Error

Source§

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

Source§

impl<Ctx> Decode<Ctx> for u32

Source§

type Error = Error

Source§

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

Source§

impl<Ctx> Decode<Ctx> for u64

Source§

type Error = Error

Source§

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

Source§

impl<Ctx> Decode<Ctx> for u128

Source§

type Error = Error

Source§

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

Source§

impl<Ctx> Decode<Ctx> for usize

Source§

type Error = Error

Source§

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

Implementors§