Struct sparse_bitfield::Bitfield
[−]
[src]
pub struct Bitfield {
pub page_size: usize,
pub pages: Pager,
// some fields omitted
}Bitfield instance.
Fields
page_size: usize
The page_size of the Page instances stored in memory-pager.
pages: Pager
A memory-pager instance.
Methods
impl Bitfield[src]
pub fn new(page_size: usize) -> Self[src]
Create a new instance.
pub fn set(&mut self, index: usize, value: bool)[src]
Set a bit to true or false.
pub fn get(&mut self, index: usize) -> bool[src]
Get the value of a bit.
pub fn len(&self) -> usize[src]
Get the amount of bits stored. Includes sparse spaces.
pub fn is_empty(&self) -> bool[src]
Check if length is zero.