pub trait ArrayBuilder: Send {
Show 13 methods
// Required methods
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
fn dtype(&self) -> &DType;
fn len(&self) -> usize;
fn append_zeros(&mut self, n: usize);
fn append_nulls(&mut self, n: usize);
fn extend_from_array(&mut self, array: &dyn Array) -> VortexResult<()>;
fn ensure_capacity(&mut self, capacity: usize);
fn set_validity(&mut self, validity: Mask);
fn finish(&mut self) -> ArrayRef;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn append_zero(&mut self) { ... }
fn append_null(&mut self) { ... }
}
Required Methods§
fn as_any(&self) -> &dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
fn dtype(&self) -> &DType
fn len(&self) -> usize
Sourcefn append_zeros(&mut self, n: usize)
fn append_zeros(&mut self, n: usize)
Appends n “zero” values to the array.
Sourcefn append_nulls(&mut self, n: usize)
fn append_nulls(&mut self, n: usize)
Appends n “null” values to the array.
Sourcefn extend_from_array(&mut self, array: &dyn Array) -> VortexResult<()>
fn extend_from_array(&mut self, array: &dyn Array) -> VortexResult<()>
Extends the array with the provided array, canonicalizing if necessary.
Sourcefn ensure_capacity(&mut self, capacity: usize)
fn ensure_capacity(&mut self, capacity: usize)
Ensure that the builder can hold at least capacity
number of items
Sourcefn set_validity(&mut self, validity: Mask)
fn set_validity(&mut self, validity: Mask)
Override builders validity with the one provided
Sourcefn finish(&mut self) -> ArrayRef
fn finish(&mut self) -> ArrayRef
Constructs an Array from the builder components.
§Panics
This function may panic if the builder’s methods are called with invalid arguments. If only the methods on this interface are used, the builder should not panic. However, specific builders have interfaces that may be misued. For example, if the number of values in a PrimitiveBuilder’s vortex_buffer::BufferMut does not match the number of validity bits, the PrimitiveBuilder’s Self::finish will panic.
Provided Methods§
fn is_empty(&self) -> bool
Sourcefn append_zero(&mut self)
fn append_zero(&mut self)
Append a “zero” value to the array.
Sourcefn append_null(&mut self)
fn append_null(&mut self)
Append a “null” value to the array.