#[non_exhaustive]pub struct SearchOptions {
pub path_filter: Option<String>,
pub file_type: Option<String>,
pub exclude_type: Option<String>,
pub file_types: Vec<String>,
pub exclude_types: Vec<String>,
pub max_results: Option<usize>,
pub case_insensitive: bool,
pub verify_pattern: Option<String>,
pub skip_line_content: bool,
pub deterministic: bool,
}Expand description
Search options.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.path_filter: Option<String>Glob pattern to restrict search to matching paths.
file_type: Option<String>File type filter (e.g., “rs”, “py”). Single-type convenience; combined
with file_types (both are honored). Prefer file_types for 2+ types
so the Roaring extension index narrows the candidate set.
exclude_type: Option<String>Exclude files of this type from results. Combined with exclude_types.
file_types: Vec<String>Include only files with one of these extensions. Empty by default.
Unlike a single file_type, multiple entries are UNIONed against the
path index (no fallback to full post-filtering), so -t rs -t py still
narrows candidates. Combined with file_type.
exclude_types: Vec<String>Exclude files with any of these extensions. Combined with exclude_type.
max_results: Option<usize>Maximum number of results.
case_insensitive: boolEnable case-insensitive matching.
verify_pattern: Option<String>If set, use this pattern for regex/literal verification instead of the routing pattern. Used by -w/-x to verify with boundary wrapping while routing on the unwrapped inner pattern for gram extraction.
skip_line_content: boolSkip populating SearchMatch::line_content, leaving it empty. Set for
output modes that only need which files matched (-l/-L), avoiding a
per-matched-line byte copy in the verifier. Do NOT set for -c, which
re-scans line_content to count per-line occurrences. Default false
(populate), so existing callers are unaffected.
deterministic: boolForce deterministic result ordering across rayon worker thread
scheduling differences (default: false). When true, the per-file
early-exit based on max_results is disabled so that the candidate set
is always fully resolved before truncation, producing identical output
regardless of thread interleaving. Costs latency on large result sets.
Replaces the SYNTEXT_DETERMINISTIC environment variable.
Trait Implementations§
Source§impl Clone for SearchOptions
impl Clone for SearchOptions
Source§fn clone(&self) -> SearchOptions
fn clone(&self) -> SearchOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SearchOptions
impl Debug for SearchOptions
Source§impl Default for SearchOptions
impl Default for SearchOptions
Source§fn default() -> SearchOptions
fn default() -> SearchOptions
Auto Trait Implementations§
impl Freeze for SearchOptions
impl RefUnwindSafe for SearchOptions
impl Send for SearchOptions
impl Sync for SearchOptions
impl Unpin for SearchOptions
impl UnsafeUnpin for SearchOptions
impl UnwindSafe for SearchOptions
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
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>
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>
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