pub struct QueryComputer<A = GlobalAllocator>where
A: AllocatorCore,{ /* private fields */ }Expand description
An opaque PreprocessedDistanceFunction for the Quantizer trait object.
§Note
This is only valid to call on Opaque slices compressed by the same Quantizer that
created the computer.
Otherwise, distance computations may return garbage values or panic.
Implementations§
Source§impl<A> QueryComputer<A>where
A: AllocatorCore,
impl<A> QueryComputer<A>where
A: AllocatorCore,
Sourcepub fn layout(&self) -> QueryLayout
pub fn layout(&self) -> QueryLayout
Report the layout used by the query computer.
Sourcepub fn into_inner(self) -> Poly<dyn DynQueryComputer, A>
pub fn into_inner(self) -> Poly<dyn DynQueryComputer, A>
This is a temporary function until custom allocator support fully comes on line.
Trait Implementations§
Source§impl<A> Debug for QueryComputer<A>where
A: AllocatorCore,
impl<A> Debug for QueryComputer<A>where
A: AllocatorCore,
Source§impl<A> PreprocessedDistanceFunction<Opaque<'_>, Result<f32, QueryDistanceError>> for QueryComputer<A>where
A: AllocatorCore,
impl<A> PreprocessedDistanceFunction<Opaque<'_>, Result<f32, QueryDistanceError>> for QueryComputer<A>where
A: AllocatorCore,
fn evaluate_similarity(&self, x: Opaque<'_>) -> Result<f32, QueryDistanceError>
Auto Trait Implementations§
impl<A> Freeze for QueryComputer<A>where
A: Freeze,
impl<A = GlobalAllocator> !RefUnwindSafe for QueryComputer<A>
impl<A> Send for QueryComputer<A>where
A: Send,
impl<A> Sync for QueryComputer<A>where
A: Sync,
impl<A> Unpin for QueryComputer<A>where
A: Unpin,
impl<A = GlobalAllocator> !UnwindSafe for QueryComputer<A>
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> 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