Module bio::data_structures::bitenc [] [src]

A fixed-width bit encoding implementation. This allows to store a sequence of values over a reduced alphabet by packing them bit-encoded into a sequence of bytes.

Example

use bio::data_structures::bitenc::BitEnc;
let mut bitenc = BitEnc::new(2);
bitenc.push(0);
bitenc.push(2);
bitenc.push(1);
let values: Vec<u8> = bitenc.iter().collect();
assert_eq!(values, [0, 2, 1]);

Structs

BitEnc

A sequence of bitencoded values.

BitEncIter

Iterator over values of a bitencoded sequence (values will be unpacked into bytes).