Skip to main content

CompressIntoWith

Trait CompressIntoWith 

Source
pub trait CompressIntoWith<From, To, A> {
    type Error: Error + 'static + Send + Sync;

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

A trait implemented by a quantizer, indicating that it is capable of quantizing the contents oF From into To with additional help from an argument of type A.

One example use case of the additional argument would be a crate::alloc::ScopedAllocator through which scratch allocations can be made.

Required Associated Types§

Source

type Error: Error + 'static + Send + Sync

Errors that may occur during compression.

Required Methods§

Source

fn compress_into_with( &self, from: From, to: To, with: A, ) -> Result<(), 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<A> CompressIntoWith<&[f32], Slice<&mut [f32], Mut<'_, FullQueryMeta>>, ScopedAllocator<'_>> for SphericalQuantizer<A>
where A: Allocator,

Source§

impl<const NBITS: usize, A> CompressIntoWith<&[f32], VectorBase<NBITS, Unsigned, MutSlicePtr<'_, u8>, Mut<'_, DataMeta>>, ScopedAllocator<'_>> for SphericalQuantizer<A>
where A: Allocator, Unsigned: Representation<NBITS>, for<'a> DataMut<'a, NBITS>: FinishCompressing,

Source§

impl<const NBITS: usize, Perm, A> CompressIntoWith<&[f32], VectorBase<NBITS, Unsigned, MutSlicePtr<'_, u8>, Mut<'_, QueryMeta>, Perm>, ScopedAllocator<'_>> for SphericalQuantizer<A>
where Unsigned: Representation<NBITS>, Perm: PermutationStrategy<NBITS>, A: Allocator,