pub trait NullBitmap:
EstimateSize
+ Clone
+ PartialEq
+ Debug
+ Send
+ Sync
+ 'static {
// Required methods
fn empty() -> Self;
fn is_empty(&self) -> bool;
fn set_true(&mut self, idx: usize);
fn contains(&self, x: usize) -> bool;
fn is_subset(&self, other: &Self) -> bool;
fn from_bool_vec<T: AsRef<[bool]> + IntoIterator<Item = bool>>(
value: T,
) -> Self;
}
Expand description
We use a trait for NullBitmap
so we can parameterize structs on it.
This is because NullBitmap
is used often, and we want it to occupy
the minimal stack space.
§Example
use risingwave_common::hash::{NullBitmap, StackNullBitmap};
struct A<B: NullBitmap> {
null_bitmap: B,
}
Then A<StackNullBitmap>
occupies 64 bytes,
and in cases which require it,
A<HeapNullBitmap>
will occupy 4 * usize bytes (on 64 bit arch that would be 256 bytes).
Required Methods§
fn empty() -> Self
fn is_empty(&self) -> bool
fn set_true(&mut self, idx: usize)
fn contains(&self, x: usize) -> bool
fn is_subset(&self, other: &Self) -> bool
fn from_bool_vec<T: AsRef<[bool]> + IntoIterator<Item = bool>>(value: T) -> Self
Object Safety§
This trait is not object safe.