Registry / utility / bit-field

bit-field

JSON →
library0.10.3rscratesunverified

Simple bit field trait providing get_bit, get_bits, set_bit, and set_bits methods for Rust's integral types.

# Cargo.toml [dependencies] bit_field = "0.10.3"
INSTALL
IMPORT
SIG · BIT-FIELD
B
bit-field
utilityrustv0.10.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BitField
use bit_field::BitField;

Sets and gets a bit in a u8 value using the BitField trait.

use bit_field::BitField; fn main() { let mut value: u8 = 0b0000_0000; value.set_bit(3, true); assert_eq!(value, 0b0000_1000); println!("Bit 3: {}", value.get_bit(3)); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.10.3latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Meta
1
Resources
bit-field — cargo add bit-field · libregistry