Dynamic-sized lightweight bitmap
Explanation
Simple, fast and easy to use bitmap.
Example
use DynBitmap;
use Write;
let source = .iter
.cycle
.take;
// You can construct bitmap from iterator with `Type = bool` or
// construct bitmap manually with `contained/1`.
//
// `DynBitmap` has high-performance `from_iter` method,
// which is preferable to `contained/1`.
let mut bitmap: DynBitmap = source.copied.collect;
// You can set value of bitmap using `set/2` function.
// It returns additional information in case of an error.
bitmap.set.unwrap;
// You can check value of some particular bit using `get/1`.
// Note, that bit index starts from `0`.
assert_eq!;
// You can iterate over bit values using `iter/0` function.
for in bitmap.iter.enumerate
let file = open.unwrap;
// `write/1` function support writing binary bitmap representation
// to anything that implement `std::io::Write`.
bitmap.write.unwrap;