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§
Required Methods§
Sourcefn validate_dtype(
&self,
metadata: &Self::Metadata,
storage_dtype: &DType,
) -> VortexResult<()>
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§
Sourcefn serialize(&self, metadata: &Self::Metadata) -> VortexResult<Vec<u8>>
fn serialize(&self, metadata: &Self::Metadata) -> VortexResult<Vec<u8>>
Serialize the metadata into a byte vector.
Sourcefn deserialize(&self, metadata: &[u8]) -> VortexResult<Self::Metadata>
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.