Struct sparse_bitfield::Bitfield [−][src]
pub struct Bitfield {
pub pages: Pager,
// some fields omitted
}Bitfield instance.
Fields
pages: Pager
A memory-pager instance.
Methods
impl Bitfield[src]
impl Bitfieldpub fn new(page_size: usize) -> Self[src]
pub fn new(page_size: usize) -> Selfpub fn set(&mut self, index: usize, value: bool) -> Change[src]
pub fn set(&mut self, index: usize, value: bool) -> ChangeSet a byte to true or false. Returns a boolean indicating if the value was changed.
pub fn get(&mut self, index: usize) -> bool[src]
pub fn get(&mut self, index: usize) -> boolGet the value of a bit.
pub fn get_byte(&self, index: usize) -> u8[src]
pub fn get_byte(&self, index: usize) -> u8Get a byte from our internal buffers.
pub fn set_byte(&mut self, index: usize, byte: u8) -> Change[src]
pub fn set_byte(&mut self, index: usize, byte: u8) -> ChangeSet a byte to the right value inside our internal buffers.
pub fn page_size(&self) -> usize[src]
pub fn page_size(&self) -> usizeGet the memory page size in bytes.
pub fn len(&self) -> usize[src]
pub fn len(&self) -> usizeGet the amount of bits in the bitfield.
pub fn is_empty(&self) -> bool[src]
pub fn is_empty(&self) -> boolReturns true if no bits are stored.
ⓘImportant traits for Iter<'a>pub fn iter(&mut self) -> Iter[src]
ⓘImportant traits for Iter<'a>
pub fn iter(&mut self) -> IterCreate an Iterator that iterates over all pages.
Trait Implementations
impl Debug for Bitfield[src]
impl Debug for Bitfieldfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Default for Bitfield[src]
impl Default for BitfieldCreate a new instance with a page_size of 1kb.