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.