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

Builder for NullArray

Example

Create a NullArray from a NullBuilder



let mut b = NullBuilder::new();
b.append_empty_value();
b.append_null();
b.append_nulls(3);
b.append_empty_values(3);
let arr = b.finish();

assert_eq!(8, arr.len());
assert_eq!(8, arr.null_count());

Implementations§

source§

impl NullBuilder

source

pub fn new() -> Self

Creates a new null builder

source

pub fn with_capacity(capacity: usize) -> Self

Creates a new null builder with space for capacity elements without re-allocating

source

pub fn capacity(&self) -> usize

Returns the capacity of this builder measured in slots of type T

source

pub fn append_null(&mut self)

Appends a null slot into the builder

source

pub fn append_nulls(&mut self, n: usize)

Appends n nulls into the builder.

source

pub fn append_empty_value(&mut self)

Appends a null slot into the builder

source

pub fn append_empty_values(&mut self, n: usize)

Appends n nulls into the builder.

source

pub fn finish(&mut self) -> NullArray

Builds the NullArray and reset this builder.

source

pub fn finish_cloned(&self) -> NullArray

Builds the NullArray without resetting the builder.

Trait Implementations§

source§

impl ArrayBuilder for NullBuilder

source§

fn as_any(&self) -> &dyn Any

Returns the builder as a non-mutable Any reference.

source§

fn as_any_mut(&mut self) -> &mut dyn Any

Returns the builder as a mutable Any reference.

source§

fn into_box_any(self: Box<Self>) -> 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 is_empty(&self) -> bool

Returns whether the number of array slots is zero

source§

fn finish(&mut self) -> ArrayRef

Builds the array and reset this builder.

source§

fn finish_cloned(&self) -> ArrayRef

Builds the array without resetting the builder.

source§

impl Debug for NullBuilder

source§

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

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

impl Default for NullBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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 Twhere T: RefUnwindSafe + Send + Sync,