pub trait EncodingArray: Clone {
type Encoding: TermEncoding;
// Required methods
fn encoding(&self) -> &Self::Encoding;
fn array(&self) -> &Arc<dyn Array>;
fn into_array(self) -> Arc<dyn Array>;
// Provided method
fn try_as_scalar(
&self,
index: usize,
) -> Result<<Self::Encoding as TermEncoding>::Scalar, DataFusionError> { ... }
}
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§
Sourcetype Encoding: TermEncoding
type Encoding: TermEncoding
The encoding used by this array.
Required Methods§
Sourcefn into_array(self) -> Arc<dyn Array>
fn into_array(self) -> Arc<dyn Array>
Consumes self
and returns the inner array.
Provided Methods§
Sourcefn try_as_scalar(
&self,
index: usize,
) -> Result<<Self::Encoding as TermEncoding>::Scalar, DataFusionError>
fn try_as_scalar( &self, index: usize, ) -> Result<<Self::Encoding as TermEncoding>::Scalar, DataFusionError>
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.