/modular-bitfield-ordering

Extends modular-bitfield crate with types u8be..u128be, u8le..u128le

Primary LanguageRustApache License 2.0Apache-2.0

Modular bitfield ordering types

This crate provide some types to use with the modular-bitfield crate:

For big endian layout: u8be, u16be, u32be, u64be, u128be
For little endian layout: u8le, u16le, u32le, u64le, u128le

It is impossible to implement similar functionality for signed numbers because trait PushBits: checks::private::Sealed cannot be implemented in a separate crate

Example

use modular_bitfield_ordering::{u16be, u32le};

#[bitfield]
struct Foo {
    a: u16be,
    b: u32le,
}