Trait VTable

Source
pub trait VTable:
    'static
    + Sized
    + Send
    + Sync
    + Debug {
    type Array: 'static + Send + Sync + Clone + Debug + Deref<Target = dyn Array> + IntoArray;
    type Encoding: 'static + Send + Sync + Clone + Deref<Target = dyn Encoding>;
    type ArrayVTable: ArrayVTable<Self>;
    type CanonicalVTable: CanonicalVTable<Self>;
    type OperationsVTable: OperationsVTable<Self>;
    type ValidityVTable: ValidityVTable<Self>;
    type VisitorVTable: VisitorVTable<Self>;
    type ComputeVTable: ComputeVTable<Self>;
    type EncodeVTable: EncodeVTable<Self>;
    type SerdeVTable: SerdeVTable<Self>;

    // Required methods
    fn id(encoding: &Self::Encoding) -> EncodingId;
    fn encoding(array: &Self::Array) -> EncodingRef;
}
Expand description

The encoding VTable encapsulates logic for an Encoding type and associated Array type. The logic is split across several “VTable” traits to enable easier code organization than simply lumping everything into a single trait.

Some of these vtables are optional, such as the SerdeVTable, which is only required if the encoding supports serialization.

From this VTable trait, we derive implementations for the sealed Array and Encoding traits via the crate::ArrayAdapter and crate::EncodingAdapter types respectively.

The functions defined in these vtable traits will typically document their pre- and post-conditions. The pre-conditions are validated inside the Array and Encoding implementations so do not need to be checked in the vtable implementations (for example, index out of bounds). Post-conditions are validated after invocation of the vtable function and will panic if violated.

Required Associated Types§

Source

type Array: 'static + Send + Sync + Clone + Debug + Deref<Target = dyn Array> + IntoArray

Source

type Encoding: 'static + Send + Sync + Clone + Deref<Target = dyn Encoding>

Source

type ArrayVTable: ArrayVTable<Self>

Source

type CanonicalVTable: CanonicalVTable<Self>

Source

type OperationsVTable: OperationsVTable<Self>

Source

type ValidityVTable: ValidityVTable<Self>

Source

type VisitorVTable: VisitorVTable<Self>

Source

type ComputeVTable: ComputeVTable<Self>

Optionally enable implementing dynamic compute dispatch for this encoding. Can be disabled by assigning to the NotSupported type.

Source

type EncodeVTable: EncodeVTable<Self>

Optionally enable the EncodeVTable for this encoding. This allows it to partake in compression. Can be disabled by assigning to the NotSupported type.

Source

type SerdeVTable: SerdeVTable<Self>

Optionally enable serde for this encoding by implementing the SerdeVTable trait. Can be disabled by assigning to the NotSupported type.

Required Methods§

Source

fn id(encoding: &Self::Encoding) -> EncodingId

Returns the ID of the encoding.

Source

fn encoding(array: &Self::Array) -> EncodingRef

Returns the encoding for the array.

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§

Source§

impl VTable for BoolVTable

Source§

impl VTable for ChunkedVTable

Source§

impl VTable for ConstantVTable

Source§

impl VTable for DecimalVTable

Source§

impl VTable for ExtensionVTable

Source§

impl VTable for ListVTable

Source§

impl VTable for NullVTable

Source§

impl VTable for PrimitiveVTable

Source§

impl VTable for StructVTable

Source§

impl VTable for VarBinVTable

Source§

impl VTable for VarBinViewVTable