Trait SerdeVTable

Source
pub trait SerdeVTable<V: VTable> {
    type Metadata: Debug + SerializeMetadata + DeserializeMetadata;

    // Required methods
    fn metadata(array: &V::Array) -> VortexResult<Option<Self::Metadata>>;
    fn build(
        encoding: &V::Encoding,
        dtype: &DType,
        len: usize,
        metadata: &<Self::Metadata as DeserializeMetadata>::Output,
        buffers: &[ByteBuffer],
        children: &dyn ArrayChildren,
    ) -> VortexResult<V::Array>;
}
Expand description

VTable for assisting with the serialization and deserialiation of arrays.

It is required to implement this vtable in order to support:

  • Serialization to disk or over IPC.
  • Import/export over FFI.

Required Associated Types§

Required Methods§

Source

fn metadata(array: &V::Array) -> VortexResult<Option<Self::Metadata>>

Exports the metadata for the array.

All other parts of the array are exported using the crate::vtable::VisitorVTable.

  • If the array does not require serialized metadata, it should return crate::metadata::EmptyMetadata.
  • If the array does not support serialization, it should return None.
Source

fn build( encoding: &V::Encoding, dtype: &DType, len: usize, metadata: &<Self::Metadata as DeserializeMetadata>::Output, buffers: &[ByteBuffer], children: &dyn ArrayChildren, ) -> VortexResult<V::Array>

Build an array from its given parts.

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§