Trait EncodingVTable

Source
pub trait EncodingVTable:
    'static
    + Sync
    + Send
    + ComputeVTable {
    // Required method
    fn id(&self) -> EncodingId;

    // Provided methods
    fn decode(
        &self,
        parts: &ArrayParts,
        ctx: &ArrayContext,
        _dtype: DType,
        _len: usize,
    ) -> VortexResult<ArrayRef> { ... }
    fn encode(
        &self,
        input: &Canonical,
        _like: Option<&dyn Array>,
    ) -> VortexResult<Option<ArrayRef>> { ... }
}
Expand description

Dyn-compatible VTable trait for a Vortex array encoding.

This trait provides extension points for arrays to implement various features of Vortex. It is split into multiple sub-traits to make it easier for consumers to break up the implementation, as well as to allow for optional implementation of certain features, for example compute functions.

Required Methods§

Source

fn id(&self) -> EncodingId

Return the ID for this encoding implementation.

Provided Methods§

Source

fn decode( &self, parts: &ArrayParts, ctx: &ArrayContext, _dtype: DType, _len: usize, ) -> VortexResult<ArrayRef>

Source

fn encode( &self, input: &Canonical, _like: Option<&dyn Array>, ) -> VortexResult<Option<ArrayRef>>

Encode the canonical array into this encoding implementation.

Should error if like is encoded with a different encoding.

Trait Implementations§

Source§

impl Debug for dyn EncodingVTable + '_

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for dyn EncodingVTable + '_

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for dyn EncodingVTable + '_

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
Source§

impl PartialEq for dyn EncodingVTable + '_

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for dyn EncodingVTable + '_

Implementors§