Add num_bytes()
to bitfield
This commit is contained in:
parent
78de4e43e2
commit
890aaf7335
@ -86,6 +86,9 @@ impl BooleanBitfield {
|
|||||||
/// vector.
|
/// vector.
|
||||||
pub fn is_empty(&self) -> bool { self.len == 0 }
|
pub fn is_empty(&self) -> bool { self.len == 0 }
|
||||||
|
|
||||||
|
/// The number of bytes required to represent the bitfield.
|
||||||
|
pub fn num_bytes(&self) -> usize { self.vec.len() }
|
||||||
|
|
||||||
/// Iterate through the underlying vector and count the number of
|
/// Iterate through the underlying vector and count the number of
|
||||||
/// true bits.
|
/// true bits.
|
||||||
pub fn num_true_bits(&self) -> u64 {
|
pub fn num_true_bits(&self) -> u64 {
|
||||||
|
Loading…
Reference in New Issue
Block a user