pub struct GrepSearchManager { /* private fields */ }Expand description
State machine for grep_file orchestration.
Implementations§
Source§impl GrepSearchManager
impl GrepSearchManager
pub fn new(search_dir: PathBuf) -> Self
Sourcepub fn on_user_query(&self, query: &str)
pub fn on_user_query(&self, query: &str)
Call whenever the user edits the search query.
Sourcepub fn last_result(&self) -> Option<GrepSearchResult>
pub fn last_result(&self) -> Option<GrepSearchResult>
Retrieve the last successful search result
Sourcepub async fn perform_search(
&self,
input: GrepSearchInput,
) -> Result<GrepSearchResult>
pub async fn perform_search( &self, input: GrepSearchInput, ) -> Result<GrepSearchResult>
Perform an actual content search with the given input parameters
Sourcepub fn enumerate_files_with_pattern(
&self,
pattern: String,
max_results: usize,
cancel_flag: Option<Arc<AtomicBool>>,
) -> Result<Vec<String>>
pub fn enumerate_files_with_pattern( &self, pattern: String, max_results: usize, cancel_flag: Option<Arc<AtomicBool>>, ) -> Result<Vec<String>>
Perform file enumeration using the optimized file search bridge
This method uses vtcode-indexer::file_search for parallel, fuzzy file discovery. It’s optimized for:
- Listing files in large directories
- Fuzzy filename matching
- Respecting .gitignore and .ignore files
- Parallel directory traversal
§Arguments
pattern- Fuzzy search pattern for filenames (e.g., “main”, “test.rs”)max_results- Maximum number of files to returncancel_flag- Optional cancellation token for early termination
§Returns
A vector of file paths matching the pattern, sorted by match quality
Sourcepub fn list_all_files(
&self,
max_results: usize,
exclude_patterns: Vec<String>,
) -> Result<Vec<String>>
pub fn list_all_files( &self, max_results: usize, exclude_patterns: Vec<String>, ) -> Result<Vec<String>>
List all files in the search directory using the file search bridge
This is useful for operations that need to enumerate all discoverable files without a specific pattern match.
§Arguments
max_results- Maximum number of files to returnexclude_patterns- Patterns to exclude from results (glob-style)
§Returns
A vector of file paths
Auto Trait Implementations§
impl Forget for GrepSearchManager
impl Freeze for GrepSearchManager
impl Move for GrepSearchManager
impl RefUnwindSafe for GrepSearchManager
impl Send for GrepSearchManager
impl Sync for GrepSearchManager
impl Unpin for GrepSearchManager
impl UnsafeUnpin for GrepSearchManager
impl UnwindSafe for GrepSearchManager
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
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> 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