pub struct Indexes { /* private fields */ }Expand description
Registry of opened indexes read from a snapshot store.
Owns a [Snapshot] that holds a reader lease, preventing the snapshot
from being garbage-collected while searches are active.
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 candidates(&self, query: &QuerySpec<'_>) -> Option<Vec<Candidate>>
pub fn candidates(&self, query: &QuerySpec<'_>) -> Option<Vec<Candidate>>
Produce narrowed candidates from all indexes that can narrow the query.
Returns None if no index could narrow. When at least one index
narrows, all narrowed candidate sets are intersected.
pub fn first(&self) -> Option<&Index>
pub fn corpus_kind(&self) -> Option<CorpusKind>
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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