arrow::array

Struct NullBuilder

pub struct NullBuilder {
    len: usize,
}
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!(0, arr.null_count());

Fields§

§len: usize

Implementations§

§

impl NullBuilder

pub fn new() -> NullBuilder

Creates a new null builder

pub fn with_capacity(_capacity: usize) -> NullBuilder

👎Deprecated: there is no actual notion of capacity in the NullBuilder, so emulating it makes little sense

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

pub fn capacity(&self) -> usize

👎Deprecated: there is no actual notion of capacity in the NullBuilder, so emulating it makes little sense

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

pub fn append_null(&mut self)

Appends a null slot into the builder

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

Appends n nulls into the builder.

pub fn append_empty_value(&mut self)

Appends a null slot into the builder

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

Appends n nulls into the builder.

pub fn finish(&mut self) -> NullArray

Builds the NullArray and reset this builder.

pub fn finish_cloned(&self) -> NullArray

Builds the NullArray without resetting the builder.

Trait Implementations§

§

impl ArrayBuilder for NullBuilder

§

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

Returns the builder as a non-mutable Any reference.

§

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

Returns the builder as a mutable Any reference.

§

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

Returns the boxed builder as a box of Any.

§

fn len(&self) -> usize

Returns the number of array slots in the builder

§

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

Builds the array and reset this builder.

§

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

Builds the array without resetting the builder.

§

fn is_empty(&self) -> bool

Returns whether number of array slots is zero
§

impl Debug for NullBuilder

§

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

Formats the value using the given formatter. Read more
§

impl Default for NullBuilder

§

fn default() -> NullBuilder

Returns the “default value” for a type. 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>,

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,