pub struct Indexes { /* private fields */ }Expand description
Registry of opened indexes read from a snapshot store.
Implementations§
Source§impl Indexes
impl Indexes
Sourcepub fn from_single(index: Index, root: PathBuf) -> Self
pub fn from_single(index: Index, root: PathBuf) -> Self
Create an Indexes registry from a single index and its root.
Useful for testing and benchmarking.
Sourcepub fn open(sift_dir: &Path) -> Result<Self, IndexError>
pub fn open(sift_dir: &Path) -> Result<Self, IndexError>
Open all indexes found under sift_dir.
§Errors
Returns IndexError::InvalidManifest if a snapshot manifest is
malformed, or IndexError::Trigram if a trigram index is malformed.
Returns an empty registry if no current snapshot exists (walk fallback).
pub const fn is_empty(&self) -> bool
pub fn root(&self) -> &Path
Sourcepub fn resolve_candidates(&self, query: &QuerySpec<'_>) -> Vec<Candidate>
pub fn resolve_candidates(&self, query: &QuerySpec<'_>) -> Vec<Candidate>
Resolve candidates for a query across all registered indexes.
Conservative sets from each [SearchIndex] are intersected using
Candidate::rel_path equality (no hashing), so distinct paths are never
merged by accident.
Sourcepub fn candidates(
&self,
query: &QuerySpec<'_>,
coverage: CandidateCoverage,
) -> Vec<Candidate>
pub fn candidates( &self, query: &QuerySpec<'_>, coverage: CandidateCoverage, ) -> Vec<Candidate>
Resolve candidates for a query, selecting narrowed or complete coverage.
Sourcepub fn resolve_all_files(&self) -> Vec<Candidate>
pub fn resolve_all_files(&self) -> Vec<Candidate>
Return all indexed files across all registered indexes.
pub fn first(&self) -> Option<&Index>
Sourcepub fn corpus_kind(&self) -> Option<CorpusKind>
pub fn corpus_kind(&self) -> Option<CorpusKind>
Returns the corpus kind if all indexes agree, or None for mixed/empty.
Auto Trait Implementations§
impl Freeze for Indexes
impl RefUnwindSafe for Indexes
impl Send for Indexes
impl Sync for Indexes
impl Unpin for Indexes
impl UnsafeUnpin for Indexes
impl UnwindSafe for Indexes
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
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