VariantBuilderExt

Trait VariantBuilderExt 

Source
pub trait VariantBuilderExt {
    type State<'a>: BuilderSpecificState + 'a
       where Self: 'a;

    // Required methods
    fn append_null(&mut self);
    fn append_value<'m, 'v>(&mut self, value: impl Into<Variant<'m, 'v>>);
    fn try_new_list(
        &mut self,
    ) -> Result<ListBuilder<'_, Self::State<'_>>, ArrowError>;
    fn try_new_object(
        &mut self,
    ) -> Result<ObjectBuilder<'_, Self::State<'_>>, ArrowError>;

    // Provided methods
    fn new_list(&mut self) -> ListBuilder<'_, Self::State<'_>> { ... }
    fn new_object(&mut self) -> ObjectBuilder<'_, Self::State<'_>> { ... }
}
Expand description

Extends VariantBuilder to help building nested Variants

Allows users to append values to a VariantBuilder, ListBuilder or ObjectBuilder. using the same interface.

Required Associated Types§

Source

type State<'a>: BuilderSpecificState + 'a where Self: 'a

The builder specific state used by nested builders

Required Methods§

Source

fn append_null(&mut self)

Appends a NULL value to this builder. The semantics depend on the implementation, but will often translate to appending a Variant::Null value.

Source

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

Appends a new variant value to this builder. See e.g. VariantBuilder::append_value.

Source

fn try_new_list( &mut self, ) -> Result<ListBuilder<'_, Self::State<'_>>, ArrowError>

Creates a nested list builder. See e.g. VariantBuilder::new_list. Returns an error if the nested builder cannot be created, see e.g. ObjectBuilder::try_new_list.

Source

fn try_new_object( &mut self, ) -> Result<ObjectBuilder<'_, Self::State<'_>>, ArrowError>

Creates a nested object builder. See e.g. VariantBuilder::new_object. Returns an error if the nested builder cannot be created, see e.g. ObjectBuilder::try_new_object.

Provided Methods§

Source

fn new_list(&mut self) -> ListBuilder<'_, Self::State<'_>>

Creates a nested list builder. See e.g. VariantBuilder::new_list. Panics if the nested builder cannot be created, see e.g. ObjectBuilder::new_list.

Source

fn new_object(&mut self) -> ObjectBuilder<'_, Self::State<'_>>

Creates a nested object builder. See e.g. VariantBuilder::new_object. Panics if the nested builder cannot be created, see e.g. ObjectBuilder::new_object.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl VariantBuilderExt for VariantBuilder

Source§

type State<'a> = () where Self: 'a

Source§

impl<'a, S: BuilderSpecificState> VariantBuilderExt for ListBuilder<'a, S>

Source§

type State<'s> = ListState<'s> where Self: 's

Source§

impl<S: BuilderSpecificState> VariantBuilderExt for ObjectFieldBuilder<'_, '_, '_, S>

Source§

type State<'a> = ObjectState<'a> where Self: 'a