pub struct FileSearcher { /* private fields */ }
Expand description
File searcher for recursive file operations
Implementations§
Source§impl FileSearcher
impl FileSearcher
Sourcepub fn new(root: PathBuf, config: FileSearchConfig) -> Self
pub fn new(root: PathBuf, config: FileSearchConfig) -> Self
Create a new file searcher
Sourcepub fn with_default_config(root: PathBuf) -> Self
pub fn with_default_config(root: PathBuf) -> Self
Create a searcher with default configuration
Sourcepub fn search_files(
&self,
pattern: Option<&str>,
) -> Result<Vec<FileSearchResult>>
pub fn search_files( &self, pattern: Option<&str>, ) -> Result<Vec<FileSearchResult>>
Recursively search for files matching the given pattern
Sourcepub fn search_files_with_content(
&self,
content_pattern: &str,
file_pattern: Option<&str>,
) -> Result<Vec<FileSearchResult>>
pub fn search_files_with_content( &self, content_pattern: &str, file_pattern: Option<&str>, ) -> Result<Vec<FileSearchResult>>
Search for files containing specific content
Sourcepub fn find_file_by_name(&self, file_name: &str) -> Result<Option<PathBuf>>
pub fn find_file_by_name(&self, file_name: &str) -> Result<Option<PathBuf>>
Find a specific file by name (recursively)
Sourcepub fn results_to_json(results: Vec<FileSearchResult>) -> Value
pub fn results_to_json(results: Vec<FileSearchResult>) -> Value
Convert search results to JSON format
Auto Trait Implementations§
impl Freeze for FileSearcher
impl RefUnwindSafe for FileSearcher
impl Send for FileSearcher
impl Sync for FileSearcher
impl Unpin for FileSearcher
impl UnwindSafe for FileSearcher
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