Enum byte::ctx::Endian[][src]

pub enum Endian {
    Little,
    Big,
}

Endian of numbers.

Default to machine’s native endian.

Example

use byte::*;

let bytes: &[u8] = &[0x00, 0xff];

let num_be: u16 = bytes.read_with(&mut 0, BE).unwrap();
assert_eq!(num_be, 0x00ff);

let num_le: u16 = bytes.read_with(&mut 0, LE).unwrap();
assert_eq!(num_le, 0xff00);

Variants

Little

Little Endian byte order context

Big

Big Endian byte order context

Trait Implementations

impl Clone for Endian[src]

impl Copy for Endian[src]

impl Debug for Endian[src]

impl Default for Endian[src]

impl Eq for Endian[src]

impl PartialEq<Endian> for Endian[src]

impl StructuralEq for Endian[src]

impl StructuralPartialEq for Endian[src]

impl<'a> TryRead<'a, Endian> for u8[src]

impl<'a> TryRead<'a, Endian> for u16[src]

impl<'a> TryRead<'a, Endian> for f32[src]

impl<'a> TryRead<'a, Endian> for f64[src]

impl<'a> TryRead<'a, Endian> for u32[src]

impl<'a> TryRead<'a, Endian> for u64[src]

impl<'a> TryRead<'a, Endian> for i8[src]

impl<'a> TryRead<'a, Endian> for i16[src]

impl<'a> TryRead<'a, Endian> for i32[src]

impl<'a> TryRead<'a, Endian> for i64[src]

impl<'a> TryRead<'a, Endian> for usize[src]

impl<'a> TryRead<'a, Endian> for isize[src]

impl TryWrite<Endian> for u8[src]

impl TryWrite<Endian> for u16[src]

impl<'a> TryWrite<Endian> for f32[src]

impl<'a> TryWrite<Endian> for f64[src]

impl TryWrite<Endian> for u32[src]

impl TryWrite<Endian> for u64[src]

impl TryWrite<Endian> for i8[src]

impl TryWrite<Endian> for i16[src]

impl TryWrite<Endian> for i32[src]

impl TryWrite<Endian> for i64[src]

impl TryWrite<Endian> for usize[src]

impl TryWrite<Endian> for isize[src]

Auto Trait Implementations

impl Send for Endian

impl Sync for Endian

impl Unpin for Endian

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, 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.