[][src]Struct read_from::LittleEndian

#[repr(transparent)]pub struct LittleEndian<T>(pub T);

A type that can be used to read/write integers in a little-endian format.

Example

use read_from::{WriteTo, ReadFrom, LittleEndian};
use std::io::Cursor;

let mut buf = vec![];
LittleEndian(0xaabbccdd_u32).write_to(&mut buf).unwrap();
assert_eq!(buf, [0xdd, 0xcc, 0xbb, 0xaa]);

let cursor = Cursor::new(&buf);
assert_eq!(0xaabbccdd_u32, LittleEndian::read_from(cursor).unwrap().0);

Trait Implementations

impl<T: Clone> Clone for LittleEndian<T>[src]

impl<T: Copy> Copy for LittleEndian<T>[src]

impl<T: Debug> Debug for LittleEndian<T>[src]

impl<T: Default> Default for LittleEndian<T>[src]

impl<T: Eq> Eq for LittleEndian<T>[src]

impl<T: Hash> Hash for LittleEndian<T>[src]

impl<T: Ord> Ord for LittleEndian<T>[src]

impl<T: PartialEq> PartialEq<LittleEndian<T>> for LittleEndian<T>[src]

impl<T: PartialOrd> PartialOrd<LittleEndian<T>> for LittleEndian<T>[src]

impl ReadFrom for LittleEndian<u8>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for LittleEndian<i8>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for LittleEndian<f32>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for LittleEndian<f64>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for LittleEndian<u16>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for LittleEndian<i16>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for LittleEndian<u32>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for LittleEndian<i32>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for LittleEndian<u64>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for LittleEndian<i64>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for LittleEndian<u128>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for LittleEndian<i128>[src]

type Error = Error

What error can happen when trying to read?

impl<T> StructuralEq for LittleEndian<T>[src]

impl<T> StructuralPartialEq for LittleEndian<T>[src]

impl WriteTo for LittleEndian<u8>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for LittleEndian<i8>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for LittleEndian<f32>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for LittleEndian<f64>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for LittleEndian<u16>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for LittleEndian<i16>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for LittleEndian<u32>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for LittleEndian<i32>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for LittleEndian<u64>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for LittleEndian<i64>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for LittleEndian<u128>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for LittleEndian<i128>[src]

type Error = Error

What error can happen when trying to write?

Auto Trait Implementations

impl<T> RefUnwindSafe for LittleEndian<T> where
    T: RefUnwindSafe

impl<T> Send for LittleEndian<T> where
    T: Send

impl<T> Sync for LittleEndian<T> where
    T: Sync

impl<T> Unpin for LittleEndian<T> where
    T: Unpin

impl<T> UnwindSafe for LittleEndian<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.