pub trait Compressor {
type ArrayType: Array;
type SchemeType: Scheme<StatsType = Self::StatsType> + ?Sized;
type StatsType: CompressorStats<ArrayType = Self::ArrayType>;
// Required methods
fn schemes() -> &'static [&'static Self::SchemeType];
fn default_scheme() -> &'static Self::SchemeType;
fn dict_scheme_code() -> <Self::SchemeType as Scheme>::CodeType;
// Provided methods
fn compress(
array: &Self::ArrayType,
is_sample: bool,
allowed_cascading: usize,
excludes: &[<Self::SchemeType as Scheme>::CodeType],
) -> VortexResult<ArrayRef>
where Self::SchemeType: 'static { ... }
fn choose_scheme(
stats: &Self::StatsType,
is_sample: bool,
allowed_cascading: usize,
excludes: &[<Self::SchemeType as Scheme>::CodeType],
) -> VortexResult<&'static Self::SchemeType> { ... }
}Expand description
A compressor for a particular input type.
The Input type should be one of the canonical array variants, e.g. PrimitiveArray.
Compressors expose a compress function.
Required Associated Types§
type ArrayType: Array
type SchemeType: Scheme<StatsType = Self::StatsType> + ?Sized
type StatsType: CompressorStats<ArrayType = Self::ArrayType>
Required Methods§
fn schemes() -> &'static [&'static Self::SchemeType]
fn default_scheme() -> &'static Self::SchemeType
fn dict_scheme_code() -> <Self::SchemeType as Scheme>::CodeType
Provided Methods§
fn compress(
array: &Self::ArrayType,
is_sample: bool,
allowed_cascading: usize,
excludes: &[<Self::SchemeType as Scheme>::CodeType],
) -> VortexResult<ArrayRef>where
Self::SchemeType: 'static,
fn choose_scheme( stats: &Self::StatsType, is_sample: bool, allowed_cascading: usize, excludes: &[<Self::SchemeType as Scheme>::CodeType], ) -> VortexResult<&'static Self::SchemeType>
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.