pub trait EncodeVTable<V: VTable> {
// Required method
fn encode(
encoding: &V::Encoding,
canonical: &Canonical,
like: Option<&V::Array>,
) -> VortexResult<Option<V::Array>>;
}
Required Methods§
Sourcefn encode(
encoding: &V::Encoding,
canonical: &Canonical,
like: Option<&V::Array>,
) -> VortexResult<Option<V::Array>>
fn encode( encoding: &V::Encoding, canonical: &Canonical, like: Option<&V::Array>, ) -> VortexResult<Option<V::Array>>
Try to encode a canonical array into this encoding.
The given like
array is passed as a template, for example if the caller knows that
this encoding was successfully used previously for a similar array.
If the encoding does not support the given array (e.g. crate::arrays::ConstantEncoding
was passed a non-constant array), then None
is returned.
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§
impl EncodeVTable<ConstantVTable> for ConstantVTable
impl<V: VTable> EncodeVTable<V> for NotSupported
Default implementation for encodings that do not support encoding.