Crates.io | packed_booleans |
lib.rs | packed_booleans |
version | 0.3.0 |
source | src |
created_at | 2023-08-18 01:07:18.828282 |
updated_at | 2023-11-23 04:00:29.842131 |
description | A crate to pack booleans together. |
homepage | |
repository | https://github.com/cod10129/packed_booleans |
max_upload_size | |
id | 947495 |
size | 16,274 |
The standard bool
type is always a full byte.
This becomes a problem when multiple booleans
are in the same struct, as 2 bool
s are stored as 2 bytes,
which is unnecessary and wastes space.
This crate exists to solve that problem.
The PackedBools
type contains 8 booleans at the cost of only a single byte of memory.
This crate is fully no_std
compatible.