pub trait Quantization:
Send
+ Sync
+ Clone
+ Debug
+ DeepSizeOf
+ Into<Quantizer>
+ TryFrom<Quantizer, Error = Error> {
type BuildParams: QuantizerBuildParams + Send + Sync;
type Metadata: QuantizerMetadata + Send + Sync;
type Storage: QuantizerStorage<Metadata = Self::Metadata> + VectorStore + Debug;
// Required methods
fn build(
data: &dyn Array,
distance_type: DistanceType,
params: &Self::BuildParams,
) -> Result<Self>;
fn code_dim(&self) -> usize;
fn column(&self) -> &'static str;
fn quantize(&self, vectors: &dyn Array) -> Result<ArrayRef>;
fn metadata_key() -> &'static str;
fn quantization_type() -> QuantizationType;
fn metadata(&self, _: Option<QuantizationMetadata>) -> Result<Value>;
fn from_metadata(
metadata: &Self::Metadata,
distance_type: DistanceType,
) -> Result<Quantizer>;
// Provided method
fn use_residual(_: DistanceType) -> bool { ... }
}
Required Associated Types§
type BuildParams: QuantizerBuildParams + Send + Sync
type Metadata: QuantizerMetadata + Send + Sync
type Storage: QuantizerStorage<Metadata = Self::Metadata> + VectorStore + Debug
Required Methods§
fn build( data: &dyn Array, distance_type: DistanceType, params: &Self::BuildParams, ) -> Result<Self>
fn code_dim(&self) -> usize
fn column(&self) -> &'static str
fn quantize(&self, vectors: &dyn Array) -> Result<ArrayRef>
fn metadata_key() -> &'static str
fn quantization_type() -> QuantizationType
fn metadata(&self, _: Option<QuantizationMetadata>) -> Result<Value>
fn from_metadata( metadata: &Self::Metadata, distance_type: DistanceType, ) -> Result<Quantizer>
Provided Methods§
fn use_residual(_: DistanceType) -> bool
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.