pub struct TrigramIndex { /* private fields */ }Implementations§
Source§impl TrigramIndex
impl TrigramIndex
Sourcepub fn build(
config: &IndexConfig<'_>,
output_dir: &Path,
paths: &[PathBuf],
) -> Result<Self>
pub fn build( config: &IndexConfig<'_>, output_dir: &Path, paths: &[PathBuf], ) -> Result<Self>
Build a trigram index from an explicit path list (or full walk when paths is empty).
§Errors
Returns an error if corpus walking, extraction, or encoding fails.
Sourcepub fn open(
index_dir: &Path,
root: &Path,
corpus_kind: CorpusKind,
) -> Result<Self>
pub fn open( index_dir: &Path, root: &Path, corpus_kind: CorpusKind, ) -> Result<Self>
Open a previously persisted trigram index from index_dir.
§Errors
Returns an error if persistence files are missing or malformed.
Sourcepub fn update(
&self,
config: &IndexConfig<'_>,
output_dir: &Path,
paths: &[PathBuf],
) -> Result<Option<Self>>
pub fn update( &self, config: &IndexConfig<'_>, output_dir: &Path, paths: &[PathBuf], ) -> Result<Option<Self>>
Update the index from the current corpus, writing artifact files
into output_dir.
Returns Ok(Some(index)) if a new index was written, or Ok(None)
if no files changed.
§Errors
Returns an error if corpus walking, extraction, or encoding fails.
Source§impl TrigramIndex
impl TrigramIndex
Sourcepub fn candidates(&self, query: &QuerySpec<'_>) -> Option<Vec<Candidate>>
pub fn candidates(&self, query: &QuerySpec<'_>) -> Option<Vec<Candidate>>
Produce narrowed candidate files for the query.
Returns None if the query can’t be narrowed (full scan required).
Sourcepub fn explain(&self, query: &QuerySpec<'_>) -> QueryPlanOutput
pub fn explain(&self, query: &QuerySpec<'_>) -> QueryPlanOutput
Returns an explanation of how a query would be handled.
Source§impl TrigramIndex
impl TrigramIndex
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TrigramIndex
impl RefUnwindSafe for TrigramIndex
impl Send for TrigramIndex
impl Sync for TrigramIndex
impl Unpin for TrigramIndex
impl UnsafeUnpin for TrigramIndex
impl UnwindSafe for TrigramIndex
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