pub struct MultiRepoManager { /* private fields */ }Expand description
Manages multiple repository roots and performs cross-repo search with RRF fusion.
Implementations§
Source§impl MultiRepoManager
impl MultiRepoManager
pub fn new() -> MultiRepoManager
pub fn with_rrf_k(self, k: f64) -> MultiRepoManager
pub fn from_config(config: &MultiRepoConfig) -> Result<MultiRepoManager, String>
pub fn add_root( &mut self, path: &str, alias: Option<&str>, ) -> Result<(), String>
Sourcepub fn with_max_roots(self, max_roots: usize) -> MultiRepoManager
pub fn with_max_roots(self, max_roots: usize) -> MultiRepoManager
Set the maximum number of roots (clamped to 1..=MAX_ROOTS_CEILING).
pub fn remove_root(&mut self, path: &str) -> Result<(), String>
pub fn list_roots(&self) -> Vec<RootInfo>
pub fn root_count(&self) -> usize
Sourcepub fn rrf_k(&self) -> f64
pub fn rrf_k(&self) -> f64
The configured RRF constant, so external fusers (e.g. the hybrid
multi-repo search) score identically to Self::search.
pub fn is_active(&self) -> bool
Sourcepub fn resolve_root(&self, repo: &str) -> Option<usize>
pub fn resolve_root(&self, repo: &str) -> Option<usize>
Resolve a repo alias or path to the corresponding root index.
Sourcepub fn search(
&mut self,
query: &str,
max_results: usize,
filter_roots: Option<&[String]>,
) -> Vec<FusedSearchResult>
pub fn search( &mut self, query: &str, max_results: usize, filter_roots: Option<&[String]>, ) -> Vec<FusedSearchResult>
Search across all roots (or a subset) and merge with Reciprocal Rank Fusion.
Sourcepub fn search_with(
&mut self,
query: &str,
max_results: usize,
filter_roots: Option<&[String]>,
per_root: impl FnMut(&str, &Path, &mut dyn FnMut() -> Vec<RepoSearchResult>) -> Vec<RepoSearchResult>,
) -> Vec<FusedSearchResult>
pub fn search_with( &mut self, query: &str, max_results: usize, filter_roots: Option<&[String]>, per_root: impl FnMut(&str, &Path, &mut dyn FnMut() -> Vec<RepoSearchResult>) -> Vec<RepoSearchResult>, ) -> Vec<FusedSearchResult>
Self::search with each root’s ranking produced through per_root:
it receives the root’s alias and path and the search of that root, and
decides whether and under what scope the search runs (an empty list
leaves the root out). The MCP tool runs every root under that root’s
own source view (#2244); fusion is unchanged.
Sourcepub fn search_single_repo(
&mut self,
repo: &str,
query: &str,
max_results: usize,
) -> Result<Vec<RepoSearchResult>, String>
pub fn search_single_repo( &mut self, repo: &str, query: &str, max_results: usize, ) -> Result<Vec<RepoSearchResult>, String>
Search within a specific repo root (no RRF, single-repo query).
Trait Implementations§
Source§impl Default for MultiRepoManager
impl Default for MultiRepoManager
Source§fn default() -> MultiRepoManager
fn default() -> MultiRepoManager
Auto Trait Implementations§
impl Forget for MultiRepoManager
impl Freeze for MultiRepoManager
impl Move for MultiRepoManager
impl RefUnwindSafe for MultiRepoManager
impl Send for MultiRepoManager
impl Sync for MultiRepoManager
impl Unpin for MultiRepoManager
impl UnsafeUnpin for MultiRepoManager
impl UnwindSafe for MultiRepoManagerwhere
RawVecInner: UnwindSafe,
HashMap<String, Vec<(usize, f64)>>: UnwindSafe,
HashMap<String, usize>: UnwindSafe,
HashMap<String, IndexedFileState>: UnwindSafe,
HashMap<String, u64>: UnwindSafe,
Arc<ChunkOrigins>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more