Struct ListBuilder

Source
pub struct ListBuilder<'a> {
    parent_state: ParentState<'a>,
    offsets: Vec<usize>,
    buffer: ValueBuffer,
    validate_unique_fields: bool,
}
Expand description

A builder for creating Variant::List values.

See the examples on VariantBuilder for usage.

Fields§

§parent_state: ParentState<'a>§offsets: Vec<usize>§buffer: ValueBuffer§validate_unique_fields: bool

Implementations§

Source§

impl<'a> ListBuilder<'a>

Source

fn new(parent_state: ParentState<'a>, validate_unique_fields: bool) -> Self

Source

pub fn with_validate_unique_fields(self, validate_unique_fields: bool) -> Self

Enables unique field key validation for objects created within this list.

Propagates the validation flag to any ObjectBuilders created using ListBuilder::new_object.

Source

fn parent_state(&mut self) -> (ParentState<'_>, bool)

Source

pub fn new_object(&mut self) -> ObjectBuilder<'_>

Returns an object builder that can be used to append a new (nested) object to this list.

WARNING: The builder will have no effect unless/until ObjectBuilder::finish is called.

Source

pub fn new_list(&mut self) -> ListBuilder<'_>

Returns a list builder that can be used to append a new (nested) list to this list.

WARNING: The builder will have no effect unless/until ListBuilder::finish is called.

Source

pub fn append_value<'m, 'd, T: Into<Variant<'m, 'd>>>(&mut self, value: T)

Appends a variant to the list.

§Panics

This method will panic if the variant contains duplicate field names in objects when validation is enabled. For a fallible version, use ListBuilder::try_append_value.

Source

pub fn try_append_value<'m, 'd, T: Into<Variant<'m, 'd>>>( &mut self, value: T, ) -> Result<(), ArrowError>

Appends a new primitive value to this list

Source

pub fn finish(self)

Finalizes this list and appends it to its parent, which otherwise remains unmodified.

Trait Implementations§

Source§

impl Drop for ListBuilder<'_>

Drop implementation for ListBuilder does nothing as the finish method must be called to finalize the list. This is to ensure that the list is always finalized before its parent builder is finalized.

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'m, 'v> VariantBuilderExt<'m, 'v> for ListBuilder<'_>

Source§

fn append_value(&mut self, value: impl Into<Variant<'m, 'v>>)

Source§

fn new_list(&mut self) -> ListBuilder<'_>

Source§

fn new_object(&mut self) -> ObjectBuilder<'_>

Auto Trait Implementations§

§

impl<'a> Freeze for ListBuilder<'a>

§

impl<'a> RefUnwindSafe for ListBuilder<'a>

§

impl<'a> Send for ListBuilder<'a>

§

impl<'a> Sync for ListBuilder<'a>

§

impl<'a> Unpin for ListBuilder<'a>

§

impl<'a> !UnwindSafe for ListBuilder<'a>

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.