From 91275adb76aa28ed8f25f0b92f2f545bf693a8d2 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Thu, 2 Oct 2025 11:12:51 +0200 Subject: [PATCH] Add necessary accessors --- crates/file-store/src/lib.rs | 4 ++++ crates/index-scheduler/src/index_mapper/mod.rs | 6 +++++- crates/milli/src/index.rs | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/crates/file-store/src/lib.rs b/crates/file-store/src/lib.rs index d43868c67..06abfcc0c 100644 --- a/crates/file-store/src/lib.rs +++ b/crates/file-store/src/lib.rs @@ -33,6 +33,10 @@ impl FileStore { std::fs::create_dir_all(&path)?; Ok(FileStore { path }) } + + pub fn path(&self) -> &Path { + &self.path + } } impl FileStore { diff --git a/crates/index-scheduler/src/index_mapper/mod.rs b/crates/index-scheduler/src/index_mapper/mod.rs index 6103fe7fc..d01582446 100644 --- a/crates/index-scheduler/src/index_mapper/mod.rs +++ b/crates/index-scheduler/src/index_mapper/mod.rs @@ -1,4 +1,4 @@ -use std::path::PathBuf; +use std::path::{Path, PathBuf}; use std::sync::{Arc, RwLock}; use std::time::Duration; use std::{fs, thread}; @@ -591,4 +591,8 @@ impl IndexMapper { pub fn set_currently_updating_index(&self, index: Option<(String, Index)>) { *self.currently_updating_index.write().unwrap() = index; } + + pub fn base_path(&self) -> &Path { + &self.base_path + } } diff --git a/crates/milli/src/index.rs b/crates/milli/src/index.rs index d5f5a45dc..c7a54d751 100644 --- a/crates/milli/src/index.rs +++ b/crates/milli/src/index.rs @@ -1983,6 +1983,11 @@ impl Index { Ok(sizes) } + + /// The underlying env for raw access + pub fn raw_env(&self) -> &heed::Env { + &self.env + } } pub struct EmbeddingsWithMetadata {