pub struct BitArray { /* fields omitted */ }
Returns a zero-cleared bit array of size size.
Sets the bit at position i to b.
let mut ba = fid::BitArray::new(8);
ba.set_bit(3, true);
assert_eq!(ba.get_bit(3), true);
assert_eq!(ba.get_bit(4), false);
ba.set_bit(256, true);
assert_eq!(ba.get_bit(256), true);
Gets the bit at position i.
Panics if the specified position exceeds the capacity.
Gets the slice of size slice_size at position i.
Panics if slice_size is greater than 64.
Sets the i-th word of size word_size to word.
let mut ba = fid::BitArray::new(128);
ba.set_word(0, 12, 0b0101_1010_1100);
assert_eq!(ba.get_word(0, 12), 0b0101_1010_1100);
ba.set_word(5, 12, 0b1010_0101_0011);
assert_eq!(ba.get_word(5, 12), 0b1010_0101_0011);
Gets the slice of size slice_size at position i.
Panics if the end position of the slice exceeds the capacity or slice_size is greater than 64.
Gets the i-th word of size word_size.
Formats the value using the given formatter. Read more