pub struct Bitmap<Buffer: BufferType = VecBuffer> { /* private fields */ }Expand description
A collection of bits.
The validity bits are stored LSB-first in the bytes of the Buffer.
Implementations§
source§impl<Buffer: BufferType> Bitmap<Buffer>
impl<Buffer: BufferType> Bitmap<Buffer>
sourcepub fn iter(&self) -> BitmapIter<'_>
pub fn iter(&self) -> BitmapIter<'_>
Returns an iterator over the bits in this Bitmap.
sourcepub unsafe fn from_raw_parts(
buffer: <Buffer as BufferType>::Buffer<u8>,
bits: usize,
offset: usize,
) -> Self
pub unsafe fn from_raw_parts( buffer: <Buffer as BufferType>::Buffer<u8>, bits: usize, offset: usize, ) -> Self
Forms a Bitmap from a buffer, a number of bits and an offset (in bits).
§Safety
Caller must ensure that the buffer contains enough bytes for the specified number of bits including the offset.
sourcepub fn get(&self, index: usize) -> Option<bool>
pub fn get(&self, index: usize) -> Option<bool>
Returns the bit at given bit index. Returns None when the index is out
of bounds.
sourcepub unsafe fn get_unchecked(&self, index: usize) -> bool
pub unsafe fn get_unchecked(&self, index: usize) -> bool
Returns the bit at given bit index. Skips bound checking.
§Safety
Caller must ensure index is within bounds.
sourcepub fn leading_bits(&self) -> usize
pub fn leading_bits(&self) -> usize
Returns the number of leading padding bits in the first byte(s) of the buffer that contain no meaningful bits. These bits should be ignored when inspecting the raw byte buffer.
sourcepub fn trailing_bits(&self) -> usize
pub fn trailing_bits(&self) -> usize
Returns the number of trailing padding bits in the last byte of the buffer that contain no meaningful bits. These bits should be ignored when inspecting the raw byte buffer.
sourcepub fn bit_index(&self, index: usize) -> usize
pub fn bit_index(&self, index: usize) -> usize
Returns the bit index for the element at the provided index.
See Bitmap::byte_index.
sourcepub fn byte_index(&self, index: usize) -> usize
pub fn byte_index(&self, index: usize) -> usize
Returns the byte index for the element at the provided index.
See Bitmap::bit_index.
Trait Implementations§
source§impl<Buffer: BufferType> BitmapRef for Bitmap<Buffer>
impl<Buffer: BufferType> BitmapRef for Bitmap<Buffer>
source§impl<Buffer: BufferType> BufferRef<u8> for Bitmap<Buffer>
impl<Buffer: BufferType> BufferRef<u8> for Bitmap<Buffer>
source§fn buffer_ref(&self) -> &Self::Buffer
fn buffer_ref(&self) -> &Self::Buffer
source§impl<Buffer: BufferType> BufferRefMut<u8> for Bitmap<Buffer>
impl<Buffer: BufferType> BufferRefMut<u8> for Bitmap<Buffer>
source§fn buffer_ref_mut(&mut self) -> &mut Self::BufferMut
fn buffer_ref_mut(&mut self) -> &mut Self::BufferMut
source§impl<Buffer: BufferType> Clone for Bitmap<Buffer>
impl<Buffer: BufferType> Clone for Bitmap<Buffer>
source§impl<Buffer: BufferType> Debug for Bitmap<Buffer>
impl<Buffer: BufferType> Debug for Bitmap<Buffer>
source§impl<Buffer: BufferType> Default for Bitmap<Buffer>
impl<Buffer: BufferType> Default for Bitmap<Buffer>
source§impl<T, Buffer: BufferType> Extend<T> for Bitmap<Buffer>
impl<T, Buffer: BufferType> Extend<T> for Bitmap<Buffer>
source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = T>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = T>,
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)source§impl<Buffer: BufferType> From<Bitmap<Buffer>> for BooleanBuffer
Available on crate feature arrow-rs only.
impl<Buffer: BufferType> From<Bitmap<Buffer>> for BooleanBuffer
arrow-rs only.source§impl<Buffer: BufferType> From<Bitmap<Buffer>> for NullBuffer
Available on crate feature arrow-rs only.
impl<Buffer: BufferType> From<Bitmap<Buffer>> for NullBuffer
arrow-rs only.source§impl<Buffer: BufferType> From<BooleanBuffer> for Bitmap<Buffer>
Available on crate feature arrow-rs only.
impl<Buffer: BufferType> From<BooleanBuffer> for Bitmap<Buffer>
arrow-rs only.source§fn from(value: BooleanBuffer) -> Self
fn from(value: BooleanBuffer) -> Self
source§impl<Buffer: BufferType> From<NullBuffer> for Bitmap<Buffer>
Available on crate feature arrow-rs only.
impl<Buffer: BufferType> From<NullBuffer> for Bitmap<Buffer>
arrow-rs only.source§fn from(value: NullBuffer) -> Self
fn from(value: NullBuffer) -> Self
source§impl<Buffer: BufferType, T> FromIterator<T> for Bitmap<Buffer>
impl<Buffer: BufferType, T> FromIterator<T> for Bitmap<Buffer>
source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
source§impl<Buffer: BufferType> Index for Bitmap<Buffer>
impl<Buffer: BufferType> Index for Bitmap<Buffer>
source§impl<'a, Buffer: BufferType> IntoIterator for &'a Bitmap<Buffer>
impl<'a, Buffer: BufferType> IntoIterator for &'a Bitmap<Buffer>
source§impl<Buffer: BufferType> IntoIterator for Bitmap<Buffer>
impl<Buffer: BufferType> IntoIterator for Bitmap<Buffer>
§type IntoIter = Take<Skip<BitUnpacked<<<Buffer as BufferType>::Buffer<u8> as IntoIterator>::IntoIter, u8>>>
type IntoIter = Take<Skip<BitUnpacked<<<Buffer as BufferType>::Buffer<u8> as IntoIterator>::IntoIter, u8>>>
source§impl<Buffer: BufferType> Length for Bitmap<Buffer>
impl<Buffer: BufferType> Length for Bitmap<Buffer>
source§impl<const N: usize, Buffer: BufferType> PartialEq<[bool; N]> for Bitmap<Buffer>
impl<const N: usize, Buffer: BufferType> PartialEq<[bool; N]> for Bitmap<Buffer>
source§impl<Buffer: BufferType> PartialEq<Bitmap<Buffer>> for BooleanBuffer
Available on crate feature arrow-rs only.
impl<Buffer: BufferType> PartialEq<Bitmap<Buffer>> for BooleanBuffer
arrow-rs only.source§impl<Buffer: BufferType> PartialEq<Bitmap<Buffer>> for NullBuffer
Available on crate feature arrow-rs only.
impl<Buffer: BufferType> PartialEq<Bitmap<Buffer>> for NullBuffer
arrow-rs only.source§impl<Buffer: BufferType> PartialEq<BooleanBuffer> for Bitmap<Buffer>
Available on crate feature arrow-rs only.
impl<Buffer: BufferType> PartialEq<BooleanBuffer> for Bitmap<Buffer>
arrow-rs only.source§fn eq(&self, other: &BooleanBuffer) -> bool
fn eq(&self, other: &BooleanBuffer) -> bool
self and other values to be equal, and is used
by ==.source§impl<Buffer: BufferType> PartialEq<NullBuffer> for Bitmap<Buffer>
Available on crate feature arrow-rs only.
impl<Buffer: BufferType> PartialEq<NullBuffer> for Bitmap<Buffer>
arrow-rs only.source§fn eq(&self, other: &NullBuffer) -> bool
fn eq(&self, other: &NullBuffer) -> bool
self and other values to be equal, and is used
by ==.source§impl<Buffer: BufferType> PartialEq for Bitmap<Buffer>
impl<Buffer: BufferType> PartialEq for Bitmap<Buffer>
source§impl<Buffer: BufferType> ValidityBitmap for Bitmap<Buffer>
impl<Buffer: BufferType> ValidityBitmap for Bitmap<Buffer>
source§fn is_null(&self, index: usize) -> Option<bool>
fn is_null(&self, index: usize) -> Option<bool>
true if the element at position index is null.source§unsafe fn is_null_unchecked(&self, index: usize) -> bool
unsafe fn is_null_unchecked(&self, index: usize) -> bool
true if the element at position index is null, without
performing any bounds checking. Read moresource§fn null_count(&self) -> usize
fn null_count(&self) -> usize
source§fn is_valid(&self, index: usize) -> Option<bool>
fn is_valid(&self, index: usize) -> Option<bool>
true if the element at position index is valid.source§unsafe fn is_valid_unchecked(&self, index: usize) -> bool
unsafe fn is_valid_unchecked(&self, index: usize) -> bool
true if the element at position index is valid, without
performing any bounds checking. Read more