EncodingArray

Trait EncodingArray 

Source
pub trait EncodingArray: Clone {
    type Encoding: TermEncoding;

    // Required methods
    fn encoding(&self) -> &Self::Encoding;
    fn array(&self) -> &ArrayRef;
    fn into_array(self) -> ArrayRef;

    // Provided method
    fn try_as_scalar(
        &self,
        index: usize,
    ) -> DFResult<<Self::Encoding as TermEncoding>::Scalar> { ... }
}
Expand description

Represents an Arrow Array with a specific TermEncoding.

The constructors of types that implement EncodingArray are meant to ensure that the ArrayRef upholds all invariants of the encoding.

Required Associated Types§

Source

type Encoding: TermEncoding

The encoding used by this array.

Required Methods§

Source

fn encoding(&self) -> &Self::Encoding

Obtains the encoding instance for this array.

Source

fn array(&self) -> &ArrayRef

Returns a reference to the inner array.

Source

fn into_array(self) -> ArrayRef

Consumes self and returns the inner array.

Provided Methods§

Source

fn try_as_scalar( &self, index: usize, ) -> DFResult<<Self::Encoding as TermEncoding>::Scalar>

Extracts a scalar from this array at index.

Returns an error if the index is out of bounds.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§