Struct bitarray_naive::BitArray
source · Expand description
A structure aimed to bring the bitarray functionality. Structure is described within two fields. “size” - The number of bits that will be allocated during the struct instance initialization. “bit_array” - The vector of 8 bit integer used to represent bits where each 8 bits are packed in every 8 bit integer.
use bitarray::BitArray;
let bitarray_size: i64 = 9999;
let mut bitarray: BitArray = BitArray::new(bitarray_size);
bitarray.set(12, true).unwrap();
assert_eq!(bitarray.get(12).unwrap(), true);
Fields§
§size: i64
§bit_array: Vec<u8>
Implementations§
source§impl BitArray
impl BitArray
sourcepub fn new(size: i64) -> Self
pub fn new(size: i64) -> Self
Constructor used to initialize a new instance of the bitarray with a given size. “size” - The number of bits that will be allocated during the struct instance initialization.