Trait lebe::io::ReadEndian

source ·
pub trait ReadEndian<T: ?Sized> {
    fn read_from_little_endian_into(&mut self, value: &mut T) -> Result<()>;
    fn read_from_big_endian_into(&mut self, value: &mut T) -> Result<()>;

    fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<()> { ... }
    fn read_from_little_endian(&mut self) -> Result<T>
    where
        T: Sized + Default
, { ... } fn read_from_big_endian(&mut self) -> Result<T>
    where
        T: Sized + Default
, { ... } fn read_from_native_endian(&mut self) -> Result<T>
    where
        T: Sized + Default
, { ... } }
Expand description

A std::io::Read input stream which supports reading any primitive values from bytes. Will decode the values from either little endian or big endian, as desired.

This extension trait is implemented for all Read types. Add use lebe::io::ReadEndian; to your code to automatically unlock this functionality for all types that implement Read.

Required Methods

Read into the supplied reference. Acts the same as std::io::Read::read_exact.

Read into the supplied reference. Acts the same as std::io::Read::read_exact.

Provided Methods

Read into the supplied reference. Acts the same as std::io::Read::read_exact.

Read the byte value of the inferred type

Read the byte value of the inferred type

Read the byte value of the inferred type

Implementors