arrow_buffer::builder

Struct BooleanBufferBuilder

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

Builder for BooleanBuffer

Fields§

§buffer: MutableBuffer§len: usize

Implementations§

Source§

impl BooleanBufferBuilder

Source

pub fn new(capacity: usize) -> Self

Creates a new BooleanBufferBuilder

Source

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

Creates a new BooleanBufferBuilder from MutableBuffer of len

Source

pub fn len(&self) -> usize

Returns the length of the buffer

Source

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

Sets a bit in the buffer at index

Source

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

Gets a bit in the buffer at index

Source

pub fn is_empty(&self) -> bool

Returns true if empty

Source

pub fn capacity(&self) -> usize

Returns the capacity of the buffer

Source

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

Advances the buffer by additional bits

Source

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

Source

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.

Source

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.

Source

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

Appends a boolean v into the buffer

Source

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

Appends n additional bits of value v into the buffer

Source

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

Appends a slice of booleans into the buffer

Source

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

Source

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

Source

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

Returns the packed bits

Source

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

Returns the packed bits

Source

pub fn finish(&mut self) -> BooleanBuffer

Creates a BooleanBuffer

Source

pub fn finish_cloned(&self) -> BooleanBuffer

Builds the BooleanBuffer without resetting the builder.

Trait Implementations§

Source§

impl Debug for BooleanBufferBuilder

Source§

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

Formats the value using the given formatter. Read more
Source§

impl From<BooleanBufferBuilder> for BooleanBuffer

Source§

fn from(builder: BooleanBufferBuilder) -> Self

Converts to this type from the input type.
Source§

impl From<BooleanBufferBuilder> for Buffer

Source§

fn from(builder: BooleanBufferBuilder) -> Self

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.
Source§

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