Skip to main content

CompressInto

Trait CompressInto 

Source
pub trait CompressInto<From, To> {
    type Error: Error + 'static + Send + Sync;
    type Output: Debug + Send + Sync;

    // Required method
    fn compress_into(
        &self,
        from: From,
        to: To,
    ) -> Result<Self::Output, Self::Error>;
}
Expand description

A trait implemented by a quantizer, indicating that it is capable of quantizing the contents oF From into To.

Required Associated Types§

Source

type Error: Error + 'static + Send + Sync

Errors that may occur during compression.

Source

type Output: Debug + Send + Sync

An output type resulting from compression.

Required Methods§

Source

fn compress_into(&self, from: From, to: To) -> Result<Self::Output, Self::Error>

Compress the data in From into To.

If an error is encountered, To must be left in a valid but undefined state.

Implementors§

Source§

impl CompressInto<&[f32], &mut [u8]> for TransposedTable

Source§

impl<'a, 'b> CompressInto<VectorBase<4, Unsigned, SlicePtr<'a, u8>, Ref<'a, MinMaxCompensation>>, VectorBase<2, Unsigned, MutSlicePtr<'b, u8>, Mut<'b, MinMaxCompensation>>> for Recompressor

Source§

impl<'a, 'b> CompressInto<VectorBase<8, Unsigned, SlicePtr<'a, u8>, Ref<'a, MinMaxCompensation>>, VectorBase<2, Unsigned, MutSlicePtr<'b, u8>, Mut<'b, MinMaxCompensation>>> for Recompressor

Source§

impl<'a, 'b> CompressInto<VectorBase<8, Unsigned, SlicePtr<'a, u8>, Ref<'a, MinMaxCompensation>>, VectorBase<4, Unsigned, MutSlicePtr<'b, u8>, Mut<'b, MinMaxCompensation>>> for Recompressor

Source§

impl<'a, 'b, const NBITS: usize, T> CompressInto<MatRef<'a, Standard<T>>, MatMut<'b, MinMaxMeta<NBITS>>> for MinMaxQuantizer
where T: Copy + Into<f32>, Unsigned: Representation<NBITS>,

Source§

impl<'a, T> CompressInto<&[T], Slice<&'a mut [f32], Mut<'a, FullQueryMeta>>> for MinMaxQuantizer
where T: Copy + Into<f32>,

Source§

impl<T> CompressInto<&[T], BitSliceBase<1, Binary, MutSlicePtr<'_, u8>>> for BinaryQuantizer
where T: PartialOrd + Default,

Source§

impl<T> CompressInto<MatrixBase<&[T]>, MatrixBase<&mut [u8]>> for TransposedTable
where T: Copy + Into<f32>,

Source§

type Error = TableBatchCompressionError

Source§

type Output = ()

Source§

impl<T, U> CompressInto<&[f32], &mut [u8]> for BasicTableBase<T, U>
where T: DenseData<Elem = f32>, U: DenseData<Elem = usize>,

Source§

impl<const NBITS: usize, T> CompressInto<&[T], VectorBase<NBITS, Unsigned, MutSlicePtr<'_, u8>, Mut<'_, MinMaxCompensation>>> for MinMaxQuantizer
where T: Copy + Into<f32>, Unsigned: Representation<NBITS>,

Source§

impl<const NBITS: usize, T, Perm> CompressInto<&[T], BitSliceBase<NBITS, Unsigned, MutSlicePtr<'_, u8>, Perm>> for ScalarQuantizer
where T: Copy + Into<f32>, Unsigned: Representation<NBITS>, Perm: PermutationStrategy<NBITS>,

Source§

impl<const NBITS: usize, T, Perm> CompressInto<&[T], VectorBase<NBITS, Unsigned, MutSlicePtr<'_, u8>, Mut<'_, Compensation>, Perm>> for ScalarQuantizer
where T: Copy + Into<f32>, Unsigned: Representation<NBITS>, Perm: PermutationStrategy<NBITS>,