Bitmap

Trait Bitmap 

Source
pub trait Bitmap {
    // Required methods
    fn new_with_capacity(max_key: usize) -> Self;
    fn set(&mut self, key: usize, value: bool);
    fn get(&self, key: usize) -> bool;
    fn byte_size(&self) -> usize;
    fn or(&self, other: &Self) -> Self;
}
Expand description

A trait to abstract bit storage for use in a Bloom2 filter.

Required Methods§

Source

fn new_with_capacity(max_key: usize) -> Self

Construct a new Bitmap impl with capacity to hold at least max_key number of bits.

Source

fn set(&mut self, key: usize, value: bool)

Set bit indexed by key to value.

Source

fn get(&self, key: usize) -> bool

Return true if the given bit index was previously set to true.

Source

fn byte_size(&self) -> usize

Return the size of the bitmap in bytes.

Source

fn or(&self, other: &Self) -> Self

Return the bitwise OR of both self and other.`

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§