Endianness

Trait Endianness 

Source
pub trait Endianness: Sealed + Copy {
    // Required methods
    fn is_le() -> bool;
    fn is_be() -> bool;
    fn endianness() -> Self;

    // Provided method
    fn as_string() -> &'static str { ... }
}
Expand description

Trait for specifying endianness of bit buffer

Required Methods§

Source

fn is_le() -> bool

Input is little endian

Source

fn is_be() -> bool

Input is big endian

Source

fn endianness() -> Self

Get an instance of the endianness

Provided Methods§

Source

fn as_string() -> &'static str

Get the endianness as string, either LittleEndian or BigEndian

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§