Skip to main content

ExtDTypeVTable

Trait ExtDTypeVTable 

Source
pub trait ExtDTypeVTable:
    'static
    + Sized
    + Send
    + Sync
    + Clone
    + Debug
    + Eq
    + Hash {
    type Metadata: 'static + Send + Sync + Clone + Debug + Display + Eq + Hash;

    // Required methods
    fn id(&self) -> ExtID;
    fn validate_dtype(
        &self,
        metadata: &Self::Metadata,
        storage_dtype: &DType,
    ) -> VortexResult<()>;

    // Provided methods
    fn serialize(&self, metadata: &Self::Metadata) -> VortexResult<Vec<u8>> { ... }
    fn deserialize(&self, metadata: &[u8]) -> VortexResult<Self::Metadata> { ... }
}
Expand description

The public API for defining new extension DTypes.

Required Associated Types§

Source

type Metadata: 'static + Send + Sync + Clone + Debug + Display + Eq + Hash

Associated type containing the deserialized metadata for this extension type

Required Methods§

Source

fn id(&self) -> ExtID

Returns the ID for this extension type.

Source

fn validate_dtype( &self, metadata: &Self::Metadata, storage_dtype: &DType, ) -> VortexResult<()>

Validate that the given storage type is compatible with this extension type.

Provided Methods§

Source

fn serialize(&self, metadata: &Self::Metadata) -> VortexResult<Vec<u8>>

Serialize the metadata into a byte vector.

Source

fn deserialize(&self, metadata: &[u8]) -> VortexResult<Self::Metadata>

Deserialize the metadata from a byte slice.

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§