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 Endian byte order context

Big Endian byte order context

Trait Implementations

impl Debug for Endian
[src]

Formats the value using the given formatter.

impl PartialEq for Endian
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Endian
[src]

impl Copy for Endian
[src]

impl Clone for Endian
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for Endian
[src]

Returns the "default value" for a type. Read more