pub enum PreparedQuery {
Full(Vec<f32>),
Int8(QuantizedVector),
Int4(Int4Vector),
Binary(BinaryVector),
}Expand description
Unstable: pre-quantized query for repeated distance computation.
Quantize a query vector once and reuse it against a homogeneous candidate list,
eliminating per-call from_f32 overhead. The query tier must match the stored data tier.
Variants§
Full(Vec<f32>)
Full f32 query.
Int8(QuantizedVector)
INT8 quantized query.
Int4(Int4Vector)
INT4 packed quantized query.
Binary(BinaryVector)
Binary sign-bit query.
Implementations§
Source§impl PreparedQuery
impl PreparedQuery
Sourcepub fn from_f32(query_f32: &[f32], tier: QuantizationTier) -> Self
pub fn from_f32(query_f32: &[f32], tier: QuantizationTier) -> Self
Quantize a query at the given tier for repeated distance calls.
Sourcepub fn tier(&self) -> QuantizationTier
pub fn tier(&self) -> QuantizationTier
Returns the quantization tier of this prepared query.
Trait Implementations§
Source§impl Clone for PreparedQuery
impl Clone for PreparedQuery
Source§fn clone(&self) -> PreparedQuery
fn clone(&self) -> PreparedQuery
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PreparedQuery
impl RefUnwindSafe for PreparedQuery
impl Send for PreparedQuery
impl Sync for PreparedQuery
impl Unpin for PreparedQuery
impl UnsafeUnpin for PreparedQuery
impl UnwindSafe for PreparedQuery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more