1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! # ringDB
//!
//! A vector database specialised for **ring queries** in high-dimensional spaces.
//!
//! Instead of nearest-neighbour search, ringDB retrieves all vectors whose
//! Euclidean distance to a query lies within a specified interval `[d-λ, d+λ]`.
//!
//! ## Quick start
//!
//! ```
//! use ringdb::{RingDb, RingDbConfig, RingQuery};
//!
//! let mut db = RingDb::new(RingDbConfig::new(4)).unwrap();
//! db.add_vector(&[1.0f32, 0.0, 0.0, 0.0], ()).unwrap();
//! db.add_vector(&[0.0, 5.0, 0.0, 0.0], ()).unwrap();
//!
//! let db = db.build().unwrap();
//! let result = db.query(&RingQuery { query: &[0.0f32; 4], d: 1.0, lambda: 0.1 }).unwrap();
//! // result.hits contains all matching vectors with their squared distances
//! ```
pub use ;
pub use ;
pub use RingDbError;
pub use ;
pub use ;
// Re-export the derive macro so users write `use ringdb::Payload` for both
// the trait and the derive, mirroring the serde pattern.
pub use Payload;
/// Private implementation details referenced by the `#[derive(Payload)]`
/// generated code. Not part of the public API; subject to change.