pub trait OutputElement:
'static
+ Sized
+ Default {
// Required methods
fn element_dtype() -> DType;
fn build(values: Vec<Self>) -> ArrayRef;
// Provided method
fn build_from<S, F>(source: S, apply: F) -> ArrayRef
where S: IndexedSource,
F: Fn(S::Item) -> Self { ... }
}Expand description
An owned row value that can be built into an all-valid column.
Skip-invalid execution uses Default only as a placeholder for invalid rows. Batch execution
masks those rows before returning the output.
Required Methods§
Sourcefn element_dtype() -> DType
fn element_dtype() -> DType
The dtype of columns built from this element type. Must be non-nullable: nullability is derived from the inputs by batch execution.
Because this method takes no arguments, the dtype must be a property of the Rust type. Use
an OutputSink when the output dtype depends on function options.
Sourcefn build(values: Vec<Self>) -> ArrayRef
fn build(values: Vec<Self>) -> ArrayRef
Build an all-valid column from one value per row.
The returned column must contain values.len() rows and match
element_dtype except for outer nullability. The default
build_from implementation and valid-row execution call this method.
Provided Methods§
Sourcefn build_from<S, F>(source: S, apply: F) -> ArrayRef
fn build_from<S, F>(source: S, apply: F) -> ArrayRef
Map a contiguous row source directly into an all-valid column.
The default collects one value per row into a Vec before calling build.
An output type can override this method when its physical representation supports a more
efficient bulk mapping. The implementation must call apply exactly once for every
source row in increasing order and return the same values as the default implementation.
An override must not introduce value-dependent errors or panics. Fallible operations
must use a fallible visitor path so that RowFn::INFALLIBLE continues to protect optimizer
transformations.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".