Skip to main content

PlatformEndian

Trait PlatformEndian 

Source
pub unsafe trait PlatformEndian { }
Expand description

Marker trait for constraining by platform endianness.

For example, LittleEndian only satisfies PlatformEndian on little-endian platforms. This can be used to, for example, constrain ZeroCopy implementations only when the configured byte order matches the platform endianness.

§Safety

Implementations must ensure that implementations are gated by the correct platform endianness.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl PlatformEndian for LittleEndian

Available on little-endian only.