Struct google_cloud_bigquery::storage::array::StructBuilder
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
impl StructBuilder
pub fn new(
fields: impl Into<Fields>,
field_builders: Vec<Box<dyn ArrayBuilder, Global>, Global>
) -> 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
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,
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
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)
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)
pub fn append_null(&mut self)
Appends a null element to the struct.
pub fn finish(&mut self) -> StructArray
pub fn finish(&mut self) -> StructArray
Builds the StructArray and reset this builder.
pub fn finish_cloned(&self) -> StructArray
pub fn finish_cloned(&self) -> StructArray
Builds the StructArray without resetting the builder.
Trait Implementations§
§impl ArrayBuilder for StructBuilder
impl ArrayBuilder for StructBuilder
§fn len(&self) -> usize
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 finish_cloned(&self) -> Arc<dyn Array, Global>
fn finish_cloned(&self) -> Arc<dyn Array, Global>
Builds the array without resetting the builder.
§fn as_any(&self) -> &(dyn Any + 'static)
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)
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>
fn into_box_any(self: Box<StructBuilder, Global>) -> Box<dyn Any, Global>
Returns the boxed builder as a box of Any.
Auto Trait Implementations§
impl !RefUnwindSafe for StructBuilder
impl Send for StructBuilder
impl !Sync for StructBuilder
impl Unpin for StructBuilder
impl !UnwindSafe for StructBuilder
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request