pub trait VectorIndexFactory: Send + Sync {
type Index: VectorIndex;
// Required methods
fn create(&self, dim: usize) -> Result<Self::Index>;
fn load(&self, path: &Path) -> Result<Self::Index>;
}Expand description
Separates “create a fresh index” from “load existing index from disk.” The factory holds the configuration (HNSW M, efConstruction, etc.) that is otherwise duplicated between the two operations.
Required Associated Types§
type Index: VectorIndex
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".