pub struct VariantArrayVariantBuilder<'a> {
parent_state: ParentState<'a>,
metadata_offsets: &'a mut Vec<usize>,
value_offsets: &'a mut Vec<usize>,
nulls: &'a mut NullBufferBuilder,
}
Expand description
A VariantBuilderExt
that writes directly to the buffers of a VariantArrayBuilder
.
If Self::finish
is not called, any changes will be rolled back
See VariantArrayBuilder::variant_builder
for an example
Fields§
§parent_state: ParentState<'a>
§metadata_offsets: &'a mut Vec<usize>
§value_offsets: &'a mut Vec<usize>
§nulls: &'a mut NullBufferBuilder
Implementations§
Source§impl<'a> VariantArrayVariantBuilder<'a>
impl<'a> VariantArrayVariantBuilder<'a>
Sourcefn new(builder: &'a mut VariantArrayBuilder) -> Self
fn new(builder: &'a mut VariantArrayBuilder) -> Self
Constructs a new VariantArrayVariantBuilder
Note this is not public as this is a structure that is logically
part of the VariantArrayBuilder
and relies on its internal structure
Sourcepub fn finish(self)
pub fn finish(self)
Called to finish the in progress variant and write it to the underlying buffers
Note if you do not call finish, on drop any changes made to the underlying buffers will be rolled back.
fn parent_state(&mut self) -> ParentState<'_>
Trait Implementations§
Source§impl Drop for VariantArrayVariantBuilder<'_>
impl Drop for VariantArrayVariantBuilder<'_>
Source§impl VariantBuilderExt for VariantArrayVariantBuilder<'_>
impl VariantBuilderExt for VariantArrayVariantBuilder<'_>
Source§fn append_value<'m, 'v>(&mut self, value: impl Into<Variant<'m, 'v>>)
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<'_>, ArrowError>
fn try_new_list(&mut self) -> Result<ListBuilder<'_>, 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<'_>, ArrowError>
fn try_new_object(&mut self) -> Result<ObjectBuilder<'_>, 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
].§fn new_list(&mut self) -> ListBuilder<'_>
fn new_list(&mut self) -> ListBuilder<'_>
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
].§fn new_object(&mut self) -> ObjectBuilder<'_>
fn new_object(&mut self) -> ObjectBuilder<'_>
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
].Auto Trait Implementations§
impl<'a> Freeze for VariantArrayVariantBuilder<'a>
impl<'a> !RefUnwindSafe for VariantArrayVariantBuilder<'a>
impl<'a> !Send for VariantArrayVariantBuilder<'a>
impl<'a> !Sync for VariantArrayVariantBuilder<'a>
impl<'a> Unpin for VariantArrayVariantBuilder<'a>
impl<'a> !UnwindSafe for VariantArrayVariantBuilder<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> JsonToVariant for Twhere
T: VariantBuilderExt,
impl<T> JsonToVariant for Twhere
T: VariantBuilderExt,
§fn append_json(&mut self, json: &str) -> Result<(), ArrowError>
fn append_json(&mut self, json: &str) -> Result<(), ArrowError>
Create a Variant from a JSON string