Crate bitfield

source ·
Expand description

This crate provides macros to generate bitfield-like struct.

See the documentation of the macros for how to use them.

Examples and tests are also a great way to understand how to use these macros.

Macros§

  • Combines bitfield_bitrange and bitfield_fields.
  • Implements BitRange and BitRangeMut for a tuple struct (or “newtype”).
  • Implements an exhaustive constructor function for a bitfield. Should only be called by bitfield! when using impl new;
  • Generates a fmt::Debug implementation.
  • Declares the fields of struct.
  • Generates and dispatches trait implementations for a struct

Traits§

  • A trait to get a single bit.
  • A trait to set a single bit.
  • A trait to get ranges of bits.
  • A trait to set ranges of bits.