arrow::array

Struct BooleanBufferBuilder

pub struct BooleanBufferBuilder {
    buffer: MutableBuffer,
    len: usize,
}
Expand description

Builder for BooleanBuffer

Fields§

§buffer: MutableBuffer§len: usize

Implementations§

§

impl BooleanBufferBuilder

pub fn new(capacity: usize) -> BooleanBufferBuilder

Creates a new BooleanBufferBuilder

pub fn new_from_buffer( buffer: MutableBuffer, len: usize, ) -> BooleanBufferBuilder

Creates a new BooleanBufferBuilder from MutableBuffer of len

pub fn len(&self) -> usize

Returns the length of the buffer

pub fn set_bit(&mut self, index: usize, v: bool)

Sets a bit in the buffer at index

pub fn get_bit(&self, index: usize) -> bool

Gets a bit in the buffer at index

pub fn is_empty(&self) -> bool

Returns true if empty

pub fn capacity(&self) -> usize

Returns the capacity of the buffer

pub fn advance(&mut self, additional: usize)

Advances the buffer by additional bits

pub fn truncate(&mut self, len: usize)

Truncates the builder to the given length

If len is greater than the buffer’s current length, this has no effect

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.

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.

pub fn append(&mut self, v: bool)

Appends a boolean v into the buffer

pub fn append_n(&mut self, additional: usize, v: bool)

Appends n additional bits of value v into the buffer

pub fn append_slice(&mut self, slice: &[bool])

Appends a slice of booleans into the buffer

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

pub fn append_buffer(&mut self, buffer: &BooleanBuffer)

pub fn as_slice(&self) -> &[u8]

Returns the packed bits

pub fn as_slice_mut(&mut self) -> &mut [u8]

Returns the packed bits

pub fn finish(&mut self) -> BooleanBuffer

Creates a BooleanBuffer

pub fn finish_cloned(&self) -> BooleanBuffer

Builds the BooleanBuffer without resetting the builder.

Trait Implementations§

§

impl Debug for BooleanBufferBuilder

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<BooleanBufferBuilder> for BooleanBuffer

§

fn from(builder: BooleanBufferBuilder) -> BooleanBuffer

Converts to this type from the input type.
§

impl From<BooleanBufferBuilder> for Buffer

§

fn from(builder: BooleanBufferBuilder) -> Buffer

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

§

impl<T> Ungil for T
where T: Send,