Struct FixedSizeBinaryBuilder
pub struct FixedSizeBinaryBuilder {
values_builder: Vec<u8>,
null_buffer_builder: NullBufferBuilder,
value_length: i32,
}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");Fields§
§values_builder: Vec<u8>§null_buffer_builder: NullBufferBuilder§value_length: i32Implementations§
§impl FixedSizeBinaryBuilder
impl FixedSizeBinaryBuilder
pub fn new(byte_width: i32) -> FixedSizeBinaryBuilder
pub fn new(byte_width: i32) -> FixedSizeBinaryBuilder
Creates a new FixedSizeBinaryBuilder
pub fn with_capacity(capacity: usize, byte_width: i32) -> FixedSizeBinaryBuilder
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
pub fn append_value(
&mut self,
value: impl AsRef<[u8]>,
) -> Result<(), ArrowError>
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.
pub fn append_null(&mut self)
pub fn append_null(&mut self)
Append a null value to the array.
pub fn append_nulls(&mut self, n: usize)
pub fn append_nulls(&mut self, n: usize)
Appends n nulls into the builder.
pub fn append_array(
&mut self,
array: &FixedSizeBinaryArray,
) -> Result<(), ArrowError>
pub fn append_array( &mut self, array: &FixedSizeBinaryArray, ) -> Result<(), ArrowError>
Appends all elements in array into the builder.
pub fn values_slice(&self) -> &[u8] ⓘ
pub fn values_slice(&self) -> &[u8] ⓘ
Returns the current values buffer as a slice
pub fn finish(&mut self) -> FixedSizeBinaryArray
pub fn finish(&mut self) -> FixedSizeBinaryArray
Builds the FixedSizeBinaryArray and reset this builder.
pub fn finish_cloned(&self) -> FixedSizeBinaryArray
pub fn finish_cloned(&self) -> FixedSizeBinaryArray
Builds the FixedSizeBinaryArray without resetting the builder.
pub fn validity_slice(&self) -> Option<&[u8]>
pub fn validity_slice(&self) -> Option<&[u8]>
Returns the current null buffer as a slice
Trait Implementations§
§impl ArrayBuilder for FixedSizeBinaryBuilder
impl ArrayBuilder for FixedSizeBinaryBuilder
§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Returns the builder as a mutable Any reference.
§fn into_box_any(self: Box<FixedSizeBinaryBuilder>) -> Box<dyn Any>
fn into_box_any(self: Box<FixedSizeBinaryBuilder>) -> Box<dyn Any>
Returns the boxed builder as a box of Any.
§fn finish_cloned(&self) -> Arc<dyn Array>
fn finish_cloned(&self) -> Arc<dyn Array>
Builds the array without resetting the builder.