[][src]Struct read_from::BigEndian

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

A type that can be used to deserialize integers in big-endian format.

Example

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

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

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

Trait Implementations

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

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

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

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

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

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

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

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

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

impl ReadFrom for BigEndian<u8>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for BigEndian<i8>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for BigEndian<f32>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for BigEndian<f64>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for BigEndian<u16>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for BigEndian<i16>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for BigEndian<u32>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for BigEndian<i32>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for BigEndian<u64>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for BigEndian<i64>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for BigEndian<u128>[src]

type Error = Error

What error can happen when trying to read?

impl ReadFrom for BigEndian<i128>[src]

type Error = Error

What error can happen when trying to read?

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

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

impl WriteTo for BigEndian<u8>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for BigEndian<i8>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for BigEndian<f32>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for BigEndian<f64>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for BigEndian<u16>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for BigEndian<i16>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for BigEndian<u32>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for BigEndian<i32>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for BigEndian<u64>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for BigEndian<i64>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for BigEndian<u128>[src]

type Error = Error

What error can happen when trying to write?

impl WriteTo for BigEndian<i128>[src]

type Error = Error

What error can happen when trying to write?

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for BigEndian<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.