Trait Decode

Source
pub trait Decode: Sized {
    // Required method
    fn decode<R: Read + ?Sized>(reader: &mut R) -> Result<Self, Error>;
}
Expand description

Things that can be decoded from binary.

Required Methods§

Source

fn decode<R: Read + ?Sized>(reader: &mut R) -> Result<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 Decode for u8

Source§

fn decode<R: Read + ?Sized>(reader: &mut R) -> Result<Self, Error>

Source§

impl Decode for u16

Source§

fn decode<R: Read + ?Sized>(reader: &mut R) -> Result<Self, Error>

Source§

impl Decode for u32

Source§

fn decode<R: Read + ?Sized>(reader: &mut R) -> Result<Self, Error>

Source§

impl Decode for u64

Source§

fn decode<R: Read + ?Sized>(reader: &mut R) -> Result<Self, Error>

Source§

impl Decode for String

Source§

fn decode<R: Read + ?Sized>(reader: &mut R) -> Result<Self, Error>

Source§

impl Decode for OnionAddrV3

Source§

fn decode<R: Read + ?Sized>(reader: &mut R) -> Result<Self, Error>

Source§

impl<A, B> Decode for (A, B)
where A: Decode, B: Decode,

Source§

fn decode<R: Read + ?Sized>(reader: &mut R) -> Result<Self, Error>

Source§

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

Source§

fn decode<R: Read + ?Sized>(reader: &mut R) -> Result<Self, Error>

Implementors§