Trait Readable

Source
pub trait Readable
where Self: Sized,
{ // Required method fn read<R: Reader>(reader: &mut R) -> Result<Self, Error>; }
Expand description

Trait that every type that can be deserialized from binary must implement. Reads directly to a Reader, a utility type thinly wrapping an underlying Read implementation.

Required Methods§

Source

fn read<R: Reader>(reader: &mut R) -> Result<Self, Error>

Reads the data necessary to this Readable from the provided reader

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 Readable for i32

Source§

fn read<R: Reader>(reader: &mut R) -> Result<i32, Error>

Source§

impl Readable for i64

Source§

fn read<R: Reader>(reader: &mut R) -> Result<i64, Error>

Source§

impl Readable for u8

Source§

fn read<R: Reader>(reader: &mut R) -> Result<u8, Error>

Source§

impl Readable for u16

Source§

fn read<R: Reader>(reader: &mut R) -> Result<u16, Error>

Source§

impl Readable for u32

Source§

fn read<R: Reader>(reader: &mut R) -> Result<u32, Error>

Source§

impl Readable for u64

Source§

fn read<R: Reader>(reader: &mut R) -> Result<u64, Error>

Source§

impl<A: Readable, B: Readable> Readable for (A, B)

Source§

impl<A: Readable, B: Readable, C: Readable> Readable for (A, B, C)

Source§

impl<A: Readable, B: Readable, C: Readable, D: Readable> Readable for (A, B, C, D)

Source§

impl<T> Readable for Vec<T>
where T: Readable,

Source§

fn read<R: Reader>(reader: &mut R) -> Result<Vec<T>, Error>

Implementors§