Crate explicit_endian
source ·Expand description
Explicit endian conversion no_std crate
A lightweight, no_std crate for convenient data conversion between different endianness formats. Simplifies managing binary data on systems with varying endianness.
Example
extern crate explicit_endian as ee;
use ee::{LittleEndian, BigEndian, Swappable};
fn main() {
let value = 42u32;
// Convert to little-endian
let le_value: LittleEndian<u32> = value.into();
// Convert to big-endian
let be_value: BigEndian<u32> = value.into();
// You can now work with le_value and be_value in their respective endianness formats.
}
Supported Data Types
u16
,u32
,u64
,u128
i16
,i32
,i64
,i128
usize
,isize
f32
,f64
Structs
- A wrapper to store data in big endian format
- A wrapper to store data in little endian format
Traits
- A trait representing data types that can be swapped between endianness formats.