pub struct CompiledSearch {
pub patterns: Vec<String>,
pub opts: SearchOptions,
pub plan: TrigramPlan,
}Fields§
§patterns: Vec<String>§opts: SearchOptions§plan: TrigramPlanImplementations§
Source§impl CompiledSearch
impl CompiledSearch
Sourcepub fn candidate_file_ids(&self, index: &Index, exhaustive: bool) -> Vec<usize>
pub fn candidate_file_ids(&self, index: &Index, exhaustive: bool) -> Vec<usize>
Returns raw candidate file IDs from index (trigram or full scan).
Does NOT apply SearchFilter - filtering happens in prepare_candidates.
Sourcepub fn run_index(
&self,
index: &Index,
filter: &SearchFilter,
output: SearchOutput,
) -> Result<bool>
pub fn run_index( &self, index: &Index, filter: &SearchFilter, output: SearchOutput, ) -> Result<bool>
Execute a search over an opened index and print results to stdout.
§Errors
Returns an error if the matcher cannot be built or stdout cannot be written.
Sourcepub fn prepare_candidates(
index: &Index,
ids: &[usize],
filter: &SearchFilter,
threshold: usize,
) -> Vec<CandidateInfo>
pub fn prepare_candidates( index: &Index, ids: &[usize], filter: &SearchFilter, threshold: usize, ) -> Vec<CandidateInfo>
Prepare CandidateInfo with parallel filter + path prep.
Source§impl CompiledSearch
impl CompiledSearch
Sourcepub fn build_matcher(&self) -> Result<RegexMatcher>
pub fn build_matcher(&self) -> Result<RegexMatcher>
§Errors
Returns an error if pattern compilation fails.
Source§impl CompiledSearch
impl CompiledSearch
Sourcepub fn new(patterns: &[String], opts: SearchOptions) -> Result<Self>
pub fn new(patterns: &[String], opts: SearchOptions) -> Result<Self>
Create a compiled search from patterns and options.
§Errors
Returns crate::Error::EmptyPatterns when no patterns are provided.
pub fn patterns(&self) -> &[String]
Trait Implementations§
Source§impl Clone for CompiledSearch
impl Clone for CompiledSearch
Source§fn clone(&self) -> CompiledSearch
fn clone(&self) -> CompiledSearch
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CompiledSearch
impl RefUnwindSafe for CompiledSearch
impl Send for CompiledSearch
impl Sync for CompiledSearch
impl Unpin for CompiledSearch
impl UnsafeUnpin for CompiledSearch
impl UnwindSafe for CompiledSearch
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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