Trait risinglight::array::ArrayBuilder
source · pub trait ArrayBuilder: Sized + Send + Sync + 'static {
type Array: Array<Builder = Self>;
fn extend_from_raw_data(
&mut self,
raw: &[<<Self::Array as Array>::Item as ToOwned>::Owned]
);
fn extend_from_nulls(&mut self, count: usize);
fn replace_bitmap(&mut self, valid: BitVec);
fn with_capacity(capacity: usize) -> Self;
fn reserve(&mut self, capacity: usize);
fn push_n(&mut self, n: usize, value: Option<&<Self::Array as Array>::Item>);
fn append(&mut self, other: &Self::Array);
fn take(&mut self) -> Self::Array;
fn new() -> Self { ... }
fn push(&mut self, value: Option<&<Self::Array as Array>::Item>) { ... }
fn finish(self) -> Self::Array { ... }
}
Expand description
A trait over all array builders.
ArrayBuilder
is a trait over all builders. You could build an array with
push
with the help of ArrayBuilder
trait. The push
function always
accepts reference to an element. e.g. for PrimitiveArray
,
you must do builder.push(Some(&1))
. For Utf8Array
, you must do
builder.push(Some("xxx"))
. Note that you don’t need to construct a String
.
The associated type Array
is the type of the corresponding array. It is the
return type of finish
.
Required Associated Types§
Required Methods§
fn extend_from_raw_data(
&mut self,
raw: &[<<Self::Array as Array>::Item as ToOwned>::Owned]
)
fn extend_from_nulls(&mut self, count: usize)
fn replace_bitmap(&mut self, valid: BitVec)
sourcefn with_capacity(capacity: usize) -> Self
fn with_capacity(capacity: usize) -> Self
Create a new builder with capacity
.