pub struct StructBuilder { /* private fields */ }
Expand description

Builder for StructArray

Note that callers should make sure that methods of all the child field builders are properly called to maintain the consistency of the data structure.

Implementations§

§

impl StructBuilder

pub fn new( fields: impl Into<Fields>, field_builders: Vec<Box<dyn ArrayBuilder, Global>, Global> ) -> StructBuilder

Creates a new StructBuilder

pub fn from_fields(fields: impl Into<Fields>, capacity: usize) -> StructBuilder

Creates a new StructBuilder from Fields and capacity

pub fn field_builder<T>(&mut self, i: usize) -> Option<&mut T>where T: ArrayBuilder,

Returns a mutable reference to the child field builder at index i. Result will be None if the input type T provided doesn’t match the actual field builder’s type.

pub fn num_fields(&self) -> usize

Returns the number of fields for the struct this builder is building.

pub fn append(&mut self, is_valid: bool)

Appends an element (either null or non-null) to the struct. The actual elements should be appended for each child sub-array in a consistent way.

pub fn append_null(&mut self)

Appends a null element to the struct.

pub fn finish(&mut self) -> StructArray

Builds the StructArray and reset this builder.

pub fn finish_cloned(&self) -> StructArray

Builds the StructArray without resetting the builder.

Trait Implementations§

§

impl ArrayBuilder for StructBuilder

§

fn len(&self) -> usize

Returns the number of array slots in the builder.

Note that this always return the first child field builder’s length, and it is the caller’s responsibility to maintain the consistency that all the child field builder should have the equal number of elements.

§

fn is_empty(&self) -> bool

Returns whether the number of array slots is zero

§

fn finish(&mut self) -> Arc<dyn Array, Global>

Builds the array.

§

fn finish_cloned(&self) -> Arc<dyn Array, Global>

Builds the array without resetting the builder.

§

fn as_any(&self) -> &(dyn Any + 'static)

Returns the builder as a non-mutable Any reference.

This is most useful when one wants to call non-mutable APIs on a specific builder type. In this case, one can first cast this into a Any, and then use downcast_ref to get a reference on the specific builder.

§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Returns the builder as a mutable Any reference.

This is most useful when one wants to call mutable APIs on a specific builder type. In this case, one can first cast this into a Any, and then use downcast_mut to get a reference on the specific builder.

§

fn into_box_any(self: Box<StructBuilder, Global>) -> Box<dyn Any, Global>

Returns the boxed builder as a box of Any.

§

impl Debug for StructBuilder

§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more