pub struct ValueBuilder(/* private fields */);Expand description
Wrapper around a Vec<u8> that provides methods for appending
primitive values, variant types, and metadata.
This is used internally by the builders to construct the
the value field for Variant values.
You can reuse an existing Vec<u8> by using the from impl
Implementations§
Source§impl ValueBuilder
impl ValueBuilder
Source§impl ValueBuilder
impl ValueBuilder
Sourcepub fn into_inner(self) -> Vec<u8> ⓘ
pub fn into_inner(self) -> Vec<u8> ⓘ
Returns the underlying buffer, consuming self
Sourcepub fn append_variant<S: BuilderSpecificState>(
state: ParentState<'_, S>,
variant: Variant<'_, '_>,
)
pub fn append_variant<S: BuilderSpecificState>( state: ParentState<'_, S>, variant: Variant<'_, '_>, )
Appends a variant to the builder.
§Panics
This method will panic if the variant contains duplicate field names in objects
when validation is enabled. For a fallible version, use ValueBuilder::try_append_variant
Sourcepub fn try_append_variant<S: BuilderSpecificState>(
state: ParentState<'_, S>,
variant: Variant<'_, '_>,
) -> Result<(), ArrowError>
pub fn try_append_variant<S: BuilderSpecificState>( state: ParentState<'_, S>, variant: Variant<'_, '_>, ) -> Result<(), ArrowError>
Tries to append a variant to the provided ParentState instance.
The attempt fails if the variant contains duplicate field names in objects when validation is enabled.
Sourcepub fn append_variant_bytes<S: BuilderSpecificState>(
state: ParentState<'_, S>,
variant: Variant<'_, '_>,
)
pub fn append_variant_bytes<S: BuilderSpecificState>( state: ParentState<'_, S>, variant: Variant<'_, '_>, )
Appends a variant to the buffer by copying raw bytes when possible.
For objects and lists, this directly copies their underlying byte representation instead of performing a logical copy and without touching the metadata builder. For other variant types, this falls back to the standard append behavior.
The caller must ensure that the metadata dictionary is already built and correct for any objects or lists being appended.