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§
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>
Sourcetype ComputeVTable: ComputeVTable<Self>
type ComputeVTable: ComputeVTable<Self>
Optionally enable implementing dynamic compute dispatch for this encoding.
Can be disabled by assigning to the NotSupported
type.
Sourcetype EncodeVTable: EncodeVTable<Self>
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.
Sourcetype SerdeVTable: SerdeVTable<Self>
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§
Sourcefn id(encoding: &Self::Encoding) -> EncodingId
fn id(encoding: &Self::Encoding) -> EncodingId
Returns the ID of the encoding.
Sourcefn encoding(array: &Self::Array) -> EncodingRef
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.