Struct arrow::array::BooleanBuilder[][src]

pub struct BooleanBuilder { /* fields omitted */ }
Expand description

Array builder for fixed-width primitive types

Example

Create a BooleanArray from a BooleanBuilder

    use arrow::array::{Array, BooleanArray, BooleanBuilder};

    let mut b = BooleanBuilder::new(4);
    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

Creates a new primitive array builder

Returns the capacity of this builder measured in slots of type T

Appends a value of type T into the builder

Appends a null slot into the builder

Appends an Option<T> into the builder

Appends a slice of type T into the builder

Appends values from a slice of type T and a validity boolean slice

Builds the BooleanArray and reset this builder.

Trait Implementations

Returns the builder as a non-mutable Any reference.

Returns the builder as a mutable Any reference.

Returns the boxed builder as a box of Any.

Returns the number of array slots in the builder

Returns whether the number of array slots is zero

Builds the array and reset this builder.

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.