pub struct Sq8Query { /* private fields */ }Expand description
A query prepared against one Sq8Codec by Sq8Codec::prepare, for
comparing with many codes.
Implementations§
Source§impl Sq8Query
impl Sq8Query
Sourcepub fn distance(&self, code: &[u8]) -> f32
pub fn distance(&self, code: &[u8]) -> f32
Approximate distance to a stored code, the same value as
Sq8Codec::distance with the query this was prepared from. A code
shorter than the query is compared over its own length. A result the
f32 sums cannot hold (not finite; under cosine, a norm too small or
too large, or a distance below 1e-4) is recomputed with f64 sums, as
search::distance does.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sq8Query
impl RefUnwindSafe for Sq8Query
impl Send for Sq8Query
impl Sync for Sq8Query
impl Unpin for Sq8Query
impl UnsafeUnpin for Sq8Query
impl UnwindSafe for Sq8Query
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more