pub struct GrepSearchOptions {
pub max_file_size: u64,
pub max_matches_per_file: usize,
pub smart_case: bool,
pub file_offset: usize,
pub page_limit: usize,
pub mode: GrepMode,
pub time_budget_ms: u64,
pub before_context: usize,
pub after_context: usize,
pub classify_definitions: bool,
pub trim_whitespace: bool,
pub abort_signal: Option<Arc<AtomicBool>>,
}Expand description
Options for grep search.
Fields§
§max_file_size: u64§max_matches_per_file: usize§smart_case: bool§file_offset: usizeFile-based pagination offset: index into the sorted/filtered file list
to start searching from. Pass 0 for the first page, then use
GrepResult::next_file_offset for subsequent pages.
page_limit: usizeMaximum number of matches to collect before stopping.
mode: GrepModeHow to interpret the search pattern. Defaults to PlainText.
time_budget_ms: u64Maximum time in milliseconds to spend searching before returning partial results. Prevents UI freezes on pathological queries. 0 = no limit.
before_context: usizeNumber of context lines to include before each match. 0 = disabled.
after_context: usizeNumber of context lines to include after each match. 0 = disabled.
classify_definitions: boolWhether to classify each match as a definition line. Adds ~2% overhead on large repos; disable for interactive grep where it is not needed.
trim_whitespace: boolStrip leading whitespace from matched lines and context lines, adjusting highlight byte offsets accordingly. Useful for AI/MCP consumers and UIs that don’t need indentation. Default: false.
abort_signal: Option<Arc<AtomicBool>>External abort signal. When provided, overrides the picker’s internal
cancellation flag. Set to true to stop the search early and return
partial results. Omit (or use ..Default::default()) to let the
picker manage cancellation.
Trait Implementations§
Source§impl Clone for GrepSearchOptions
impl Clone for GrepSearchOptions
Source§fn clone(&self) -> GrepSearchOptions
fn clone(&self) -> GrepSearchOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GrepSearchOptions
impl Debug for GrepSearchOptions
Auto Trait Implementations§
impl Freeze for GrepSearchOptions
impl RefUnwindSafe for GrepSearchOptions
impl Send for GrepSearchOptions
impl Sync for GrepSearchOptions
impl Unpin for GrepSearchOptions
impl UnsafeUnpin for GrepSearchOptions
impl UnwindSafe for GrepSearchOptions
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> 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>
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