Skip to main content

GrepCandidateIndex

Trait GrepCandidateIndex 

Source
pub trait GrepCandidateIndex: Send + Sync {
    // Required method
    fn select_paths(
        &self,
        pattern: &str,
        case_insensitive: bool,
    ) -> GrepCandidateSelection;
}
Expand description

Content-level grep candidate provider.

Implementations use an in-tree trigram plan (tgrep-style). They must never become the match authority: Code still runs the exact regex over admitted file bytes.

Required Methods§

Source

fn select_paths( &self, pattern: &str, case_insensitive: bool, ) -> GrepCandidateSelection

Select candidate relative paths for pattern.

Returning GrepCandidateSelection::Unconstrained or GrepCandidateSelection::Unavailable disables pruning for this query. Empty GrepCandidateSelection::Paths means “no file can match” and is a valid narrowing result.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§