pub struct PreparedQueryWithMeta {
pub query: PreparedQuery,
pub norm: NormalizationHint,
}Expand description
A prepared query annotated with a normalization hint for fast-path dispatch.
When norm == NormalizationHint::Unit and the stored vector is also unit-normalized,
approximate_cosine_distance_prepared_with_meta skips the norm division and uses
1.0 - dot_product(q, s) directly — recovering ~26% at 384d on the Full tier.
Fields§
§query: PreparedQueryThe quantized query (owns the data).
norm: NormalizationHintCaller assertion about the query vector’s normalization state.
Implementations§
Source§impl PreparedQueryWithMeta
impl PreparedQueryWithMeta
Sourcepub fn from_f32(
query_f32: &[f32],
tier: QuantizationTier,
norm: NormalizationHint,
) -> Self
pub fn from_f32( query_f32: &[f32], tier: QuantizationTier, norm: NormalizationHint, ) -> Self
Create a prepared query from an f32 vector, asserting its normalization state.
Sourcepub fn tier(&self) -> QuantizationTier
pub fn tier(&self) -> QuantizationTier
Returns the quantization tier.
Trait Implementations§
Source§impl Clone for PreparedQueryWithMeta
impl Clone for PreparedQueryWithMeta
Source§fn clone(&self) -> PreparedQueryWithMeta
fn clone(&self) -> PreparedQueryWithMeta
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 PreparedQueryWithMeta
impl RefUnwindSafe for PreparedQueryWithMeta
impl Send for PreparedQueryWithMeta
impl Sync for PreparedQueryWithMeta
impl Unpin for PreparedQueryWithMeta
impl UnsafeUnpin for PreparedQueryWithMeta
impl UnwindSafe for PreparedQueryWithMeta
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