arrow::array

Struct GenericListViewBuilder

pub struct GenericListViewBuilder<OffsetSize, T>
where OffsetSize: OffsetSizeTrait, T: ArrayBuilder,
{ offsets_builder: BufferBuilder<OffsetSize>, sizes_builder: BufferBuilder<OffsetSize>, null_buffer_builder: NullBufferBuilder, values_builder: T, field: Option<Arc<Field>>, current_offset: OffsetSize, }
Expand description

Fields§

§offsets_builder: BufferBuilder<OffsetSize>§sizes_builder: BufferBuilder<OffsetSize>§null_buffer_builder: NullBufferBuilder§values_builder: T§field: Option<Arc<Field>>§current_offset: OffsetSize

Implementations§

§

impl<OffsetSize, T> GenericListViewBuilder<OffsetSize, T>
where OffsetSize: OffsetSizeTrait, T: ArrayBuilder,

pub fn new(values_builder: T) -> GenericListViewBuilder<OffsetSize, T>

Creates a new GenericListViewBuilder from a given values array builder

pub fn with_capacity( values_builder: T, capacity: usize, ) -> GenericListViewBuilder<OffsetSize, T>

Creates a new GenericListViewBuilder from a given values array builder capacity is the number of items to pre-allocate space for in this builder

pub fn with_field( self, field: impl Into<Arc<Field>>, ) -> GenericListViewBuilder<OffsetSize, T>

By default a nullable field is created with the name item

Note: Self::finish and Self::finish_cloned will panic if the field’s data type does not match that of T

§

impl<OffsetSize, T> GenericListViewBuilder<OffsetSize, T>
where OffsetSize: OffsetSizeTrait, T: ArrayBuilder + 'static,

pub fn values(&mut self) -> &mut T

Returns the child array builder as a mutable reference.

This mutable reference can be used to append values into the child array builder, but you must call append to delimit each distinct list value.

pub fn values_ref(&self) -> &T

Returns the child array builder as an immutable reference

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

Finish the current variable-length list array slot

§Panics

Panics if the length of Self::values exceeds OffsetSize::MAX

pub fn append_value<I, V>(&mut self, i: I)
where T: Extend<Option<V>>, I: IntoIterator<Item = Option<V>>,

Append value into this GenericListViewBuilder

pub fn append_null(&mut self)

Append a null to this GenericListViewBuilder

See Self::append_value for an example use.

pub fn append_option<I, V>(&mut self, i: Option<I>)
where T: Extend<Option<V>>, I: IntoIterator<Item = Option<V>>,

Appends an optional value into this GenericListViewBuilder

If Some calls Self::append_value otherwise calls Self::append_null

pub fn finish(&mut self) -> GenericListViewArray<OffsetSize>

Builds the GenericListViewArray and reset this builder.

pub fn finish_cloned(&self) -> GenericListViewArray<OffsetSize>

Builds the GenericListViewArray without resetting the builder.

pub fn offsets_slice(&self) -> &[OffsetSize]

Returns the current offsets buffer as a slice

Trait Implementations§

§

impl<OffsetSize, T> ArrayBuilder for GenericListViewBuilder<OffsetSize, T>
where OffsetSize: OffsetSizeTrait, T: ArrayBuilder,

§

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<GenericListViewBuilder<OffsetSize, T>>, ) -> 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<OffsetSize, T> Debug for GenericListViewBuilder<OffsetSize, T>
where OffsetSize: Debug + OffsetSizeTrait, T: Debug + ArrayBuilder,

§

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

Formats the value using the given formatter. Read more
§

impl<O, T> Default for GenericListViewBuilder<O, T>

§

fn default() -> GenericListViewBuilder<O, T>

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

impl<O, B, V, E> Extend<Option<V>> for GenericListViewBuilder<O, B>
where O: OffsetSizeTrait, B: ArrayBuilder + Extend<E>, V: IntoIterator<Item = E>,

§

fn extend<T>(&mut self, iter: T)
where T: IntoIterator<Item = Option<V>>,

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more

Auto Trait Implementations§

§

impl<OffsetSize, T> Freeze for GenericListViewBuilder<OffsetSize, T>
where T: Freeze, OffsetSize: Freeze,

§

impl<OffsetSize, T> RefUnwindSafe for GenericListViewBuilder<OffsetSize, T>
where T: RefUnwindSafe, OffsetSize: RefUnwindSafe,

§

impl<OffsetSize, T> Send for GenericListViewBuilder<OffsetSize, T>

§

impl<OffsetSize, T> Sync for GenericListViewBuilder<OffsetSize, T>

§

impl<OffsetSize, T> Unpin for GenericListViewBuilder<OffsetSize, T>
where T: Unpin, OffsetSize: Unpin,

§

impl<OffsetSize, T> UnwindSafe for GenericListViewBuilder<OffsetSize, T>
where T: UnwindSafe, OffsetSize: UnwindSafe,

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,