Struct ValueBuilder
pub struct ValueBuilder(Vec<u8>);
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
Tuple Fields§
§0: Vec<u8>
Implementations§
§impl ValueBuilder
impl ValueBuilder
pub fn new() -> ValueBuilder
pub fn new() -> ValueBuilder
Construct a ValueBuffer that will write to a new underlying Vec
§impl ValueBuilder
impl ValueBuilder
pub fn into_inner(self) -> Vec<u8> ⓘ
pub fn into_inner(self) -> Vec<u8> ⓘ
Returns the underlying buffer, consuming self
pub fn append_variant<S>(state: ParentState<'_, S>, variant: Variant<'_, '_>)where
S: BuilderSpecificState,
pub fn append_variant<S>(state: ParentState<'_, S>, variant: Variant<'_, '_>)where
S: BuilderSpecificState,
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
pub fn try_append_variant<S>(
state: ParentState<'_, S>,
variant: Variant<'_, '_>,
) -> Result<(), ArrowError>where
S: BuilderSpecificState,
pub fn try_append_variant<S>(
state: ParentState<'_, S>,
variant: Variant<'_, '_>,
) -> Result<(), ArrowError>where
S: BuilderSpecificState,
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.
pub fn append_variant_bytes<S>(
state: ParentState<'_, S>,
variant: Variant<'_, '_>,
)where
S: BuilderSpecificState,
pub fn append_variant_bytes<S>(
state: ParentState<'_, S>,
variant: Variant<'_, '_>,
)where
S: BuilderSpecificState,
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.
Trait Implementations§
§impl Debug for ValueBuilder
impl Debug for ValueBuilder
§impl Default for ValueBuilder
impl Default for ValueBuilder
§fn default() -> ValueBuilder
fn default() -> ValueBuilder
Auto Trait Implementations§
impl Freeze for ValueBuilder
impl RefUnwindSafe for ValueBuilder
impl Send for ValueBuilder
impl Sync for ValueBuilder
impl Unpin for ValueBuilder
impl UnwindSafe for ValueBuilder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more