pub struct ExactIndex { /* private fields */ }Expand description
Deterministic brute-force cosine oracle.
Implementations§
Source§impl ExactIndex
impl ExactIndex
Sourcepub fn build(
config: IndexConfig,
vectors: &[(u64, &[f32])],
) -> Result<Self, SearchError>
pub fn build( config: IndexConfig, vectors: &[(u64, &[f32])], ) -> Result<Self, SearchError>
Validates and normalizes all vectors.
§Errors
Returns a typed configuration, vector, capacity, or allocation error.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub const fn dimensions(&self) -> usize
Sourcepub fn search(
&self,
query: &[f32],
count: usize,
) -> Result<Vec<SearchHit>, SearchError>
pub fn search( &self, query: &[f32], count: usize, ) -> Result<Vec<SearchHit>, SearchError>
Returns exact top-K hits ordered by distance and then key.
§Errors
Returns a typed error for an invalid query.
Sourcepub fn search_batch(
&self,
queries: &[&[f32]],
count: usize,
) -> Result<Vec<Vec<SearchHit>>, SearchError>
pub fn search_batch( &self, queries: &[&[f32]], count: usize, ) -> Result<Vec<Vec<SearchHit>>, SearchError>
Searches independent queries with bounded standard-library workers.
Output order matches input order.
§Errors
Returns the first query error in input order or a worker-panic error.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExactIndex
impl RefUnwindSafe for ExactIndex
impl Send for ExactIndex
impl Sync for ExactIndex
impl Unpin for ExactIndex
impl UnsafeUnpin for ExactIndex
impl UnwindSafe for ExactIndex
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