Struct arrow_array::builder::BooleanBufferBuilder
source · pub struct BooleanBufferBuilder { /* private fields */ }Expand description
A builder for creating a boolean Buffer
Implementations§
source§impl BooleanBufferBuilder
impl BooleanBufferBuilder
sourcepub fn new_from_buffer(buffer: MutableBuffer, len: usize) -> Self
pub fn new_from_buffer(buffer: MutableBuffer, len: usize) -> Self
Creates a new BooleanBufferBuilder from MutableBuffer of len
sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserve space to at least additional new bits.
Capacity will be >= self.len() + additional.
New bytes are uninitialized and reading them is undefined behavior.
sourcepub fn resize(&mut self, len: usize)
pub fn resize(&mut self, len: usize)
Resizes the buffer, either truncating its contents (with no change in capacity), or
growing it (potentially reallocating it) and writing false in the newly available bits.
sourcepub fn append_n(&mut self, additional: usize, v: bool)
pub fn append_n(&mut self, additional: usize, v: bool)
Appends n additional bits of value v into the buffer
sourcepub fn append_slice(&mut self, slice: &[bool])
pub fn append_slice(&mut self, slice: &[bool])
Appends a slice of booleans into the buffer
sourcepub fn append_packed_range(&mut self, range: Range<usize>, to_set: &[u8])
pub fn append_packed_range(&mut self, range: Range<usize>, to_set: &[u8])
Append range bits from to_set
to_set is a slice of bits packed LSB-first into [u8]
Panics
Panics if to_set does not contain ceil(range.end / 8) bytes
sourcepub fn as_slice_mut(&mut self) -> &mut [u8] ⓘ
pub fn as_slice_mut(&mut self) -> &mut [u8] ⓘ
Returns the packed bits
Trait Implementations§
source§impl Debug for BooleanBufferBuilder
impl Debug for BooleanBufferBuilder
source§impl From<BooleanBufferBuilder> for Buffer
impl From<BooleanBufferBuilder> for Buffer
source§fn from(builder: BooleanBufferBuilder) -> Self
fn from(builder: BooleanBufferBuilder) -> Self
Converts to this type from the input type.