Trait BitmapSlice
pub trait BitmapSlice {
Show 17 methods
// Required methods
fn get(&self, index: usize) -> bool;
fn len(&self) -> usize;
fn iter_data(&self) -> impl Iterator<Item = u64> + '_;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn count_overlapping_with(&self, other: &impl BitmapSlice) -> usize
where Self: Sized { ... }
fn overlaps_with(&self, other: &impl BitmapSlice) -> bool
where Self: Sized { ... }
fn is_all_zeros(&self) -> bool { ... }
fn is_subset_of(&self, other: &impl BitmapSlice) -> bool { ... }
fn flipped(&self) -> Flipped<'_, Self>
where Self: Sized { ... }
fn anded_with<'r, B: BitmapSlice>(
&'r self,
other: &'r B,
) -> AndWith<'r, Self, B>
where Self: Sized { ... }
fn xored_with<'r, B: BitmapSlice>(
&'r self,
other: &'r B,
) -> XorWith<'r, Self, B>
where Self: Sized { ... }
fn ored_with<'r, B: BitmapSlice>(
&'r self,
other: &'r B,
) -> OrWith<'r, Self, B>
where Self: Sized { ... }
fn cleared_from<'r, B: BitmapSlice>(
&'r self,
other: &'r B,
) -> ClearFrom<'r, Self, B>
where Self: Sized { ... }
fn iter_one_indices(&self) -> impl Iterator<Item = usize> + '_ { ... }
fn iter(&self) -> impl Iterator<Item = bool> + '_ { ... }
fn count_ones(&self) -> usize { ... }
fn count_zeros(&self) -> usize { ... }
}
Expand description
A read-only bitmap slice.
Required Methods§
Provided Methods§
fn count_overlapping_with(&self, other: &impl BitmapSlice) -> usizewhere
Self: Sized,
fn count_overlapping_with(&self, other: &impl BitmapSlice) -> usizewhere
Self: Sized,
Counts the number of bits that are one in both this bitmap and other
.
fn overlaps_with(&self, other: &impl BitmapSlice) -> boolwhere
Self: Sized,
fn overlaps_with(&self, other: &impl BitmapSlice) -> boolwhere
Self: Sized,
Returns true if the bitmap overlaps with other
.
In other words, if there is any bit which is set in both bitmaps.
fn is_all_zeros(&self) -> bool
fn is_all_zeros(&self) -> bool
Returns true if all bits in the bitmap are set to one.
fn is_subset_of(&self, other: &impl BitmapSlice) -> bool
fn is_subset_of(&self, other: &impl BitmapSlice) -> bool
Returns true if, for all bits set in the bitmap, it is also set in other
.
fn flipped(&self) -> Flipped<'_, Self>where
Self: Sized,
fn flipped(&self) -> Flipped<'_, Self>where
Self: Sized,
Returns a slice to a bitmap where each bit is negated.
fn anded_with<'r, B: BitmapSlice>(
&'r self,
other: &'r B,
) -> AndWith<'r, Self, B>where
Self: Sized,
fn anded_with<'r, B: BitmapSlice>(
&'r self,
other: &'r B,
) -> AndWith<'r, Self, B>where
Self: Sized,
Returns a slice to a bitmap where each bit is ANDed with other
.
fn xored_with<'r, B: BitmapSlice>(
&'r self,
other: &'r B,
) -> XorWith<'r, Self, B>where
Self: Sized,
fn xored_with<'r, B: BitmapSlice>(
&'r self,
other: &'r B,
) -> XorWith<'r, Self, B>where
Self: Sized,
Returns a slice to a bitmap where each bit is XORed with other
.
fn ored_with<'r, B: BitmapSlice>(&'r self, other: &'r B) -> OrWith<'r, Self, B>where
Self: Sized,
fn ored_with<'r, B: BitmapSlice>(&'r self, other: &'r B) -> OrWith<'r, Self, B>where
Self: Sized,
Returns a slice to a bitmap where each bit is ORed with other
.
fn cleared_from<'r, B: BitmapSlice>(
&'r self,
other: &'r B,
) -> ClearFrom<'r, Self, B>where
Self: Sized,
fn cleared_from<'r, B: BitmapSlice>(
&'r self,
other: &'r B,
) -> ClearFrom<'r, Self, B>where
Self: Sized,
Returns a slice to a bitmap where each bit is set to self & !other
.
fn iter_one_indices(&self) -> impl Iterator<Item = usize> + '_
fn iter_one_indices(&self) -> impl Iterator<Item = usize> + '_
Iterates over all indices in the bitmap that are set to one.
fn count_ones(&self) -> usize
fn count_ones(&self) -> usize
Counts the number of bits that are one.
fn count_zeros(&self) -> usize
fn count_zeros(&self) -> usize
Counts the number of bits that are zero.
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.