pub trait Readable<const N: usize> {
// Required methods
fn complete_chunks(&self) -> usize;
fn get_chunk(&self, chunk: usize) -> [u8; N];
fn last_chunk(&self) -> ([u8; N], u64);
fn pruned_chunks(&self) -> usize;
fn len(&self) -> u64;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn pruned_bits(&self) -> u64 { ... }
fn get_bit(&self, bit: u64) -> bool { ... }
fn ones_iter_from(&self, pos: u64) -> OnesIter<'_, Self, N> ⓘ
where Self: Sized { ... }
fn ones_iter_range(&self, range: Range<u64>) -> OnesIter<'_, Self, N> ⓘ
where Self: Sized { ... }
}Expand description
Read-only access to a bitmap’s chunks and metadata.
Required Methods§
Sourcefn complete_chunks(&self) -> usize
fn complete_chunks(&self) -> usize
Return the number of complete (fully filled) chunks.
Sourcefn get_chunk(&self, chunk: usize) -> [u8; N]
fn get_chunk(&self, chunk: usize) -> [u8; N]
Return the chunk data at the given absolute chunk index.
Sourcefn last_chunk(&self) -> ([u8; N], u64)
fn last_chunk(&self) -> ([u8; N], u64)
Return the last chunk and its size in bits.
Sourcefn pruned_chunks(&self) -> usize
fn pruned_chunks(&self) -> usize
Return the number of pruned chunks.
Provided Methods§
Sourcefn pruned_bits(&self) -> u64
fn pruned_bits(&self) -> u64
Return the number of pruned bits (i.e. pruned chunks * bits per chunk).
Sourcefn ones_iter_from(&self, pos: u64) -> OnesIter<'_, Self, N> ⓘwhere
Self: Sized,
fn ones_iter_from(&self, pos: u64) -> OnesIter<'_, Self, N> ⓘwhere
Self: Sized,
Returns an iterator over the indices of set bits starting from pos.
If pos falls within a pruned region, iteration starts at the first
unpruned bit instead.
Sourcefn ones_iter_range(&self, range: Range<u64>) -> OnesIter<'_, Self, N> ⓘwhere
Self: Sized,
fn ones_iter_range(&self, range: Range<u64>) -> OnesIter<'_, Self, N> ⓘwhere
Self: Sized,
Returns an iterator over the indices of set bits in range.
Iteration starts at the first unpruned bit at or after range.start and stops before the
smaller of range.end and the bitmap length. Empty or reversed ranges yield no bits.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".