Crate packed_char

source ·
Expand description

PackedChar stores either a char or a U22 in 32 bits of space.

§Examples

use packed_char::{PackedChar, U22, Contents};
assert_eq!(PackedChar::from('a').contents(), Contents::Char('a'));
assert_eq!(PackedChar::try_from(42)?.contents(), Contents::U22(U22::from_u32(42)?));

Structs§

  • Stores either a char or a U22 in 32 bits of space.
  • A 22-bit unsigned integer.
  • Error type for 32-bit to 22-bit integer conversion.

Enums§