siann 1.0.0

Serve nearest-neighbor indexes built by the siann Python package (exact, IVF, CAGRA graphs) from Rust, on the CPU, with the same results
Documentation
//! Serving indexes that the [siann](https://pypi.org/project/siann/) Python package built: load the file
//! `index.save(path)` wrote, and search it on the CPU from Rust, with the same neighbors, in the same order, as
//! the Python package's search on the CPU. Build and calibrate where building is fast (a GPU, through siann's
//! own builder, NVIDIA's cuVS or mlxvs); serve the saved index from a Rust service on any machine.
//!
//! ```no_run
//! let index = siann::Index::load("approx.siann")?;
//! let queries = vec![0.0f32; 10 * index.dim()];          // ten queries, row by row
//! let found = index.search(&queries, 10)?;              // each query's 10 nearest
//! println!("{:?} {:?}", &found.ids[..10], &found.scores[..10]);
//! # Ok::<(), siann::Error>(())
//! ```
//!
//! Exact search, the IVF and CAGRA graphs, for L2, cosine, inner product, L1 and L-infinity; each batch takes
//! the path the index measured fastest on the CPU for its size, at the calibrated widths, unless
//! [`Index::search_with`] names one. Scores are each metric's natural value (the distance for L2, L1 and
//! L-infinity; the similarity for cosine and inner product). The same code is the Python package's CPU engine;
//! its other modules are internal.

#![deny(unsafe_code)] // allowed only in `blas` (the calls into the platform's BLAS) and `half` (float16 widening)

#[doc(hidden)]
pub mod blas;
#[doc(hidden)]
pub mod elem;
#[doc(hidden)]
pub mod flat;
#[doc(hidden)]
pub mod graph;
#[doc(hidden)]
pub mod graph_build;
#[doc(hidden)]
pub mod half;
mod index;
#[doc(hidden)]
pub mod ivf;
#[doc(hidden)]
pub mod kernels;
#[doc(hidden)]
pub mod metric;
#[doc(hidden)]
pub mod npz;
#[doc(hidden)]
pub mod ops;
#[doc(hidden)]
pub mod products;
#[doc(hidden)]
pub mod routes;
#[cfg(test)]
mod tests;

pub use index::{Error, Index, Method, Neighbors, SearchPath};

/// An error, as a message: the bindings raise it as Python's `ValueError`.
#[doc(hidden)]
pub type Result<T> = std::result::Result<T, String>;

/// A matrix borrowed from the caller, row-major: `data` holds `rows` rows of `cols` values.
#[doc(hidden)]
#[derive(Clone, Copy)]
pub struct Mat<'a, T> {
    pub data: &'a [T],
    pub rows: usize,
    pub cols: usize,
}