pub struct ParallelSearcher { /* private fields */ }Expand description
Long-lived fan-out searcher (2g.2): T pinned snapshot readers, each owning one contiguous id slice of the fingerprint keyspace. Send the same query to all slices, merge survivors, exact-rescore on reader 0.
Implementations§
Source§impl ParallelSearcher
impl ParallelSearcher
Sourcepub fn nearest(
&mut self,
q: &[f32],
k: usize,
metric: Metric,
oversample: usize,
) -> Result<Vec<(u64, f32)>>
pub fn nearest( &mut self, q: &[f32], k: usize, metric: Metric, oversample: usize, ) -> Result<Vec<(u64, f32)>>
&mut self: each spawned thread takes EXCLUSIVE &mut access to its
own reader – Graph is deliberately not Sync (single-threaded cells),
and this is the honest way to say “one reader per thread”.
Auto Trait Implementations§
impl !RefUnwindSafe for ParallelSearcher
impl !Sync for ParallelSearcher
impl !UnwindSafe for ParallelSearcher
impl Freeze for ParallelSearcher
impl Send for ParallelSearcher
impl Unpin for ParallelSearcher
impl UnsafeUnpin for ParallelSearcher
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