pub struct FileFinder { /* private fields */ }Expand description
File finder with fuzzy matching and caching
Uses the ignore crate from ripgrep to automatically respect .gitignore
Implementations§
Source§impl FileFinder
impl FileFinder
Sourcepub fn new(working_dir: PathBuf) -> Self
pub fn new(working_dir: PathBuf) -> Self
Create a new FileFinder for the given working directory Automatically respects .gitignore, .ignore, and other standard ignore files
Sourcepub fn scan_files(&mut self) -> &Vec<PathBuf>
pub fn scan_files(&mut self) -> &Vec<PathBuf>
Scan directory and return all files (relative paths)
The ignore crate automatically handles .gitignore, .ignore, etc.
Sourcepub fn filter_files(&self, files: &[PathBuf], query: &str) -> Vec<FileMatch>
pub fn filter_files(&self, files: &[PathBuf], query: &str) -> Vec<FileMatch>
Filter files by query using fuzzy matching with frizbee
Sourcepub fn working_dir(&self) -> &Path
pub fn working_dir(&self) -> &Path
Get the working directory
Sourcepub fn refresh_cache(&mut self)
pub fn refresh_cache(&mut self)
Force refresh the cache
Auto Trait Implementations§
impl Freeze for FileFinder
impl RefUnwindSafe for FileFinder
impl Send for FileFinder
impl Sync for FileFinder
impl Unpin for FileFinder
impl UnsafeUnpin for FileFinder
impl UnwindSafe for FileFinder
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
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