Trait Endify

Source
pub trait Endify {
    // Required methods
    fn to_le(self) -> Self;
    fn to_be(self) -> Self;
    fn from_le(self) -> Self;
    fn from_be(self) -> Self;
}
Expand description

A trait for converting between endianess-formts effortlessly.

Required Methods§

Source

fn to_le(self) -> Self

Converts a struct to little-endian format.

Source

fn to_be(self) -> Self

Converts a struct to big-endian format.

Source

fn from_le(self) -> Self

Converts a struct stored in little-endian format to native-endian format.

Source

fn from_be(self) -> Self

Converts a struct stored in big-endian format to native-endian format.

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§