Struct google_cloud_bigquery::storage::array::BooleanBuilder
pub struct BooleanBuilder { /* private fields */ }Expand description
Builder for BooleanArray
Example
Create a BooleanArray from a BooleanBuilder
let mut b = BooleanBuilder::new();
b.append_value(true);
b.append_null();
b.append_value(false);
b.append_value(true);
let arr = b.finish();
assert_eq!(4, arr.len());
assert_eq!(1, arr.null_count());
assert_eq!(true, arr.value(0));
assert!(arr.is_valid(0));
assert!(!arr.is_null(0));
assert!(!arr.is_valid(1));
assert!(arr.is_null(1));
assert_eq!(false, arr.value(2));
assert!(arr.is_valid(2));
assert!(!arr.is_null(2));
assert_eq!(true, arr.value(3));
assert!(arr.is_valid(3));
assert!(!arr.is_null(3));Implementations§
§impl BooleanBuilder
impl BooleanBuilder
pub fn new() -> BooleanBuilder
pub fn new() -> BooleanBuilder
Creates a new boolean builder
pub fn with_capacity(capacity: usize) -> BooleanBuilder
pub fn with_capacity(capacity: usize) -> BooleanBuilder
Creates a new boolean builder with space for capacity elements without re-allocating
pub fn append_value(&mut self, v: bool)
pub fn append_value(&mut self, v: bool)
Appends a value of type T into the builder
pub fn append_null(&mut self)
pub fn append_null(&mut self)
Appends a null slot into the builder
pub fn append_nulls(&mut self, n: usize)
pub fn append_nulls(&mut self, n: usize)
Appends n nulls into the builder.
pub fn append_option(&mut self, v: Option<bool>)
pub fn append_option(&mut self, v: Option<bool>)
Appends an Option<T> into the builder
pub fn append_slice(&mut self, v: &[bool])
pub fn append_slice(&mut self, v: &[bool])
Appends a slice of type T into the builder
pub fn append_values(
&mut self,
values: &[bool],
is_valid: &[bool]
) -> Result<(), ArrowError>
pub fn append_values( &mut self, values: &[bool], is_valid: &[bool] ) -> Result<(), ArrowError>
Appends values from a slice of type T and a validity boolean slice.
Returns an error if the slices are of different lengths
pub fn finish(&mut self) -> BooleanArray
pub fn finish(&mut self) -> BooleanArray
Builds the BooleanArray and reset this builder.
pub fn finish_cloned(&self) -> BooleanArray
pub fn finish_cloned(&self) -> BooleanArray
Builds the BooleanArray without resetting the builder.
Trait Implementations§
§impl ArrayBuilder for BooleanBuilder
impl ArrayBuilder for BooleanBuilder
§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.
§fn into_box_any(self: Box<BooleanBuilder, Global>) -> Box<dyn Any, Global>
fn into_box_any(self: Box<BooleanBuilder, Global>) -> Box<dyn Any, Global>
Returns the boxed builder as a box of Any.
§fn finish_cloned(&self) -> Arc<dyn Array, Global>
fn finish_cloned(&self) -> Arc<dyn Array, Global>
Builds the array without resetting the builder.
§impl Debug for BooleanBuilder
impl Debug for BooleanBuilder
§impl Default for BooleanBuilder
impl Default for BooleanBuilder
§fn default() -> BooleanBuilder
fn default() -> BooleanBuilder
Returns the “default value” for a type. Read more
§impl Extend<Option<bool>> for BooleanBuilder
impl Extend<Option<bool>> for BooleanBuilder
§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = Option<bool>>,
fn extend<T>(&mut self, iter: T)where T: IntoIterator<Item = Option<bool>>,
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Auto Trait Implementations§
impl RefUnwindSafe for BooleanBuilder
impl Send for BooleanBuilder
impl Sync for BooleanBuilder
impl Unpin for BooleanBuilder
impl UnwindSafe for BooleanBuilder
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
Mutably borrows from an owned value. Read more
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>
Wrap the input message
T in a tonic::Request