pub struct FixedSizeBinaryBuilder { /* private fields */ }
Expand description

Builder for FixedSizeBinaryArray

let mut builder = FixedSizeBinaryBuilder::with_capacity(3, 5);
// [b"hello", null, b"arrow"]
builder.append_value(b"hello").unwrap();
builder.append_null();
builder.append_value(b"arrow").unwrap();

let array = builder.finish();
assert_eq!(array.value(0), b"hello");
assert!(array.is_null(1));
assert_eq!(array.value(2), b"arrow");

Implementations§

source§

impl FixedSizeBinaryBuilder

source

pub fn new(byte_width: i32) -> FixedSizeBinaryBuilder

Creates a new FixedSizeBinaryBuilder

source

pub fn with_capacity(capacity: usize, byte_width: i32) -> FixedSizeBinaryBuilder

Creates a new FixedSizeBinaryBuilder, capacity is the number of byte slices that can be appended without reallocating

source

pub fn append_value( &mut self, value: impl AsRef<[u8]> ) -> Result<(), ArrowError>

Appends a byte slice into the builder.

Automatically update the null buffer to delimit the slice appended in as a distinct value element.

source

pub fn append_null(&mut self)

Append a null value to the array.

source

pub fn finish(&mut self) -> FixedSizeBinaryArray

Builds the FixedSizeBinaryArray and reset this builder.

source

pub fn finish_cloned(&self) -> FixedSizeBinaryArray

Builds the FixedSizeBinaryArray without resetting the builder.

Trait Implementations§

source§

impl ArrayBuilder for FixedSizeBinaryBuilder

source§

fn as_any(&self) -> &(dyn Any + 'static)

Returns the builder as a non-mutable Any reference.

source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Returns the builder as a mutable Any reference.

source§

fn into_box_any(self: Box<FixedSizeBinaryBuilder>) -> Box<dyn Any>

Returns the boxed builder as a box of Any.

source§

fn len(&self) -> usize

Returns the number of array slots in the builder

source§

fn finish(&mut self) -> Arc<dyn Array>

Builds the array and reset this builder.

source§

fn finish_cloned(&self) -> Arc<dyn Array>

Builds the array without resetting the builder.

source§

fn is_empty(&self) -> bool

Returns whether number of array slots is zero
source§

impl Debug for FixedSizeBinaryBuilder

source§

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

Formats the value using the given formatter. Read more

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>,

§

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>,

§

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,

source§

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