Struct ValueBuffer

Source
struct ValueBuffer(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§

Source§

impl ValueBuffer

Source

fn new() -> Self

Construct a ValueBuffer that will write to a new underlying Vec

Source§

impl ValueBuffer

Source

fn append_u8(&mut self, term: u8)

Source

fn append_slice(&mut self, other: &[u8])

Source

fn append_primitive_header(&mut self, primitive_type: VariantPrimitiveType)

Source

fn inner(&self) -> &[u8]

Source

fn into_inner(self) -> Vec<u8>

Source

fn inner_mut(&mut self) -> &mut Vec<u8>

Source

fn append_null(&mut self)

Source

fn append_bool(&mut self, value: bool)

Source

fn append_int8(&mut self, value: i8)

Source

fn append_int16(&mut self, value: i16)

Source

fn append_int32(&mut self, value: i32)

Source

fn append_int64(&mut self, value: i64)

Source

fn append_float(&mut self, value: f32)

Source

fn append_double(&mut self, value: f64)

Source

fn append_date(&mut self, value: NaiveDate)

Source

fn append_timestamp_micros(&mut self, value: DateTime<Utc>)

Source

fn append_timestamp_ntz_micros(&mut self, value: NaiveDateTime)

Source

fn append_decimal4(&mut self, decimal4: VariantDecimal4)

Source

fn append_decimal8(&mut self, decimal8: VariantDecimal8)

Source

fn append_decimal16(&mut self, decimal16: VariantDecimal16)

Source

fn append_binary(&mut self, value: &[u8])

Source

fn append_short_string(&mut self, value: ShortString<'_>)

Source

fn append_string(&mut self, value: &str)

Source

fn offset(&self) -> usize

Source

fn new_object<'a>( &'a mut self, metadata_builder: &'a mut MetadataBuilder, ) -> ObjectBuilder<'a>

Source

fn new_list<'a>( &'a mut self, metadata_builder: &'a mut MetadataBuilder, ) -> ListBuilder<'a>

Source

fn append_variant<'m, 'd>( &mut self, variant: Variant<'m, 'd>, metadata_builder: &mut MetadataBuilder, )

Appends a variant to the buffer.

§Panics

This method will panic if the variant contains duplicate field names in objects when validation is enabled. For a fallible version, use ValueBuffer::try_append_variant

Source

fn try_append_variant<'m, 'd>( &mut self, variant: Variant<'m, 'd>, metadata_builder: &mut MetadataBuilder, ) -> Result<(), ArrowError>

Source

fn append_header(&mut self, header_byte: u8, is_large: bool, num_items: usize)

Writes out the header byte for a variant object or list

Source

fn append_offset_array( &mut self, offsets: impl IntoIterator<Item = usize>, data_size: Option<usize>, nbytes: u8, )

Writes out the offsets for an array of offsets, including the final offset (data size).

Trait Implementations§

Source§

impl Debug for ValueBuffer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ValueBuffer

Source§

fn default() -> ValueBuffer

Returns the “default value” for a type. Read more
Source§

impl From<ValueBuffer> for Vec<u8>

Source§

fn from(value_buffer: ValueBuffer) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u8>> for ValueBuffer

Source§

fn from(value: Vec<u8>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.