[][src]Trait lebe::io::ReadEndian

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_little_endian(&mut self) -> Result<T>
    where
        T: Sized + Default
, { ... }
fn read_from_big_endian(&mut self) -> Result<T>
    where
        T: Sized + Default
, { ... } }

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

fn read_from_little_endian_into(&mut self, value: &mut T) -> Result<()>

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

fn read_from_big_endian_into(&mut self, value: &mut T) -> Result<()>

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

Loading content...

Provided methods

fn read_from_little_endian(&mut self) -> Result<T> where
    T: Sized + Default

Read the byte value of the inferred type

fn read_from_big_endian(&mut self) -> Result<T> where
    T: Sized + Default

Read the byte value of the inferred type

Loading content...

Implementors

impl<R: Read> ReadEndian<f32> for R[src]

impl<R: Read> ReadEndian<f64> for R[src]

impl<R: Read> ReadEndian<i128> for R[src]

impl<R: Read> ReadEndian<i16> for R[src]

impl<R: Read> ReadEndian<i32> for R[src]

impl<R: Read> ReadEndian<i64> for R[src]

impl<R: Read> ReadEndian<i8> for R[src]

impl<R: Read> ReadEndian<[f32]> for R[src]

impl<R: Read> ReadEndian<[f64]> for R[src]

impl<R: Read> ReadEndian<[i128]> for R[src]

impl<R: Read> ReadEndian<[i16]> for R[src]

impl<R: Read> ReadEndian<[i32]> for R[src]

impl<R: Read> ReadEndian<[i64]> for R[src]

impl<R: Read> ReadEndian<[i8]> for R[src]

impl<R: Read> ReadEndian<[u128]> for R[src]

impl<R: Read> ReadEndian<[u16]> for R[src]

impl<R: Read> ReadEndian<[u32]> for R[src]

impl<R: Read> ReadEndian<[u64]> for R[src]

impl<R: Read> ReadEndian<[u8]> for R[src]

impl<R: Read> ReadEndian<u128> for R[src]

impl<R: Read> ReadEndian<u16> for R[src]

impl<R: Read> ReadEndian<u32> for R[src]

impl<R: Read> ReadEndian<u64> for R[src]

impl<R: Read> ReadEndian<u8> for R[src]

Loading content...