pub struct VariantArrayVariantBuilder<'a> {
finished: bool,
metadata_offset: usize,
value_offset: usize,
array_builder: &'a mut VariantArrayBuilder,
variant_builder: VariantBuilder,
}
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§
§finished: bool
was finish called?
metadata_offset: usize
starting offset in the variant_builder’s metadata
buffer
value_offset: usize
starting offset in the variant_builder’s value
buffer
array_builder: &'a mut VariantArrayBuilder
Parent array builder that this variant builder writes to. Buffers have been moved into the variant builder, and must be returned on drop
variant_builder: VariantBuilder
Builder for the in progress variant value, temporarily owns the buffers
from array_builder
Implementations§
Source§impl<'a> VariantArrayVariantBuilder<'a>
impl<'a> VariantArrayVariantBuilder<'a>
Sourcefn new(
array_builder: &'a mut VariantArrayBuilder,
metadata_buffer: Vec<u8>,
value_buffer: Vec<u8>,
) -> Self
fn new( array_builder: &'a mut VariantArrayBuilder, metadata_buffer: Vec<u8>, value_buffer: Vec<u8>, ) -> 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
Trait Implementations§
Source§impl<'a> Drop for VariantArrayVariantBuilder<'a>
impl<'a> Drop for VariantArrayVariantBuilder<'a>
Source§impl<'a> VariantBuilderExt for VariantArrayVariantBuilder<'a>
impl<'a> VariantBuilderExt for VariantArrayVariantBuilder<'a>
fn append_value<'m, 'v>(&mut self, value: impl Into<Variant<'m, 'v>>)
fn new_list(&mut self) -> ListBuilder<'_>
fn new_object(&mut self) -> ObjectBuilder<'_>
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