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 Bitfield
pub fn new(page_size: usize) -> Self
[src]
pub fn new(page_size: usize) -> Self
pub fn set(&mut self, index: usize, value: bool) -> Change
[src]
pub fn set(&mut self, index: usize, value: bool) -> Change
Set 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) -> bool
Get the value of a bit.
pub fn get_byte(&self, index: usize) -> u8
[src]
pub fn get_byte(&self, index: usize) -> u8
Get 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) -> Change
Set a byte to the right value inside our internal buffers.
pub fn page_size(&self) -> usize
[src]
pub fn page_size(&self) -> usize
Get the memory page size in bytes.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
Get the amount of bits in the bitfield.
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Returns 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) -> Iter
Create an Iterator
that iterates over all pages.
Trait Implementations
impl Debug for Bitfield
[src]
impl Debug for Bitfield
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for Bitfield
[src]
impl Default for Bitfield
Create a new instance with a page_size
of 1kb
.