pub struct SearchIndex { /* private fields */ }Expand description
RAM-resident trigram index over one project root.
Implementations§
Source§impl SearchIndex
impl SearchIndex
Sourcepub fn build(
root: &str,
respect_gitignore: bool,
allow_secret_paths: bool,
) -> Option<Self>
pub fn build( root: &str, respect_gitignore: bool, allow_secret_paths: bool, ) -> Option<Self>
Build the index by walking root with the exact same config and filters
as ctx_search, so the searchable file universe is identical.
Sourcepub fn candidate_paths(&self, pattern: &str, ext: Option<&str>) -> CandidateSet
pub fn candidate_paths(&self, pattern: &str, ext: Option<&str>) -> CandidateSet
Candidate files for pattern, filtered by ext. None means “no safe
narrowing possible” — the caller should scan the full file list.
Narrowing is applied only for pure [A-Za-z0-9_] literals of length ≥ 3.
For such a literal every match contains it on a single line, hence the
file contains all of its consecutive trigrams: intersecting their
posting lists yields a superset of matching files (zero false
negatives), which the caller then regex-verifies.
Auto Trait Implementations§
impl Freeze for SearchIndex
impl RefUnwindSafe for SearchIndex
impl Send for SearchIndex
impl Sync for SearchIndex
impl Unpin for SearchIndex
impl UnsafeUnpin for SearchIndex
impl UnwindSafe for SearchIndex
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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>
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