Skip to main content

VariantStorageBuilder

Trait VariantStorageBuilder 

Source
pub trait VariantStorageBuilder: Send + 'static {
    // Required methods
    fn as_any_mut(&mut self) -> &mut dyn Any;
    fn len(&self) -> usize;
    fn finish(self: Box<Self>) -> VortexResult<ArrayRef>;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

Builds the core storage of a Variant in the physical encoding of one storage array.

A VariantBuilder cannot merge the storage it receives, because the canonical Variant leaves the storage encoding open. A storage encoding that can merge its arrays installs a builder of its own through VariantBuilder::append_storage instead, so that consecutive arrays of that encoding finish as one array of it rather than one chunk each.

Required Methods§

Source

fn as_any_mut(&mut self) -> &mut dyn Any

Returns the builder as Any, so that its encoding can recognise it.

Source

fn len(&self) -> usize

The number of rows appended so far.

Source

fn finish(self: Box<Self>) -> VortexResult<ArrayRef>

Finishes the storage, an array of the builder’s Variant dtype with one row per appended row.

Provided Methods§

Source

fn is_empty(&self) -> bool

Whether no row has been appended.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§