pub struct FilePicker { /* private fields */ }Implementations§
Source§impl FilePicker
impl FilePicker
pub fn base_path(&self) -> &Path
pub fn warmup_mmap_cache(&self) -> bool
pub fn mode(&self) -> FFFMode
pub fn git_root(&self) -> Option<&Path>
Sourcepub fn get_files(&self) -> &[FileItem]
pub fn get_files(&self) -> &[FileItem]
Get all indexed files sorted by path. Note: Files are stored sorted by PATH for efficient insert/remove. For frecency-sorted results, use search() which sorts matched results.
Create a new FilePicker and place it into the provided shared handle.
The background scan thread and file-system watcher write into the
provided SharedPicker and read frecency data from the provided
SharedFrecency.
Multiple independent instances can coexist in the same process.
Sourcepub fn fuzzy_search<'a, 'q>(
files: &'a [FileItem],
query: &'q FFFQuery<'q>,
options: FuzzySearchOptions<'q>,
) -> SearchResult<'a>
pub fn fuzzy_search<'a, 'q>( files: &'a [FileItem], query: &'q FFFQuery<'q>, options: FuzzySearchOptions<'q>, ) -> SearchResult<'a>
Perform fuzzy search on files with a pre-parsed query.
The query should be parsed using QueryParser::parse() before calling this function.
This allows the caller to handle location parsing and other preprocessing.
§Arguments
files- Slice of files to searchquery- The raw query string (used for max_typos calculation and debugging)parsed- Pre-parsed query result (can be None for simple single-token queries)options- Search options including pagination, threading, and scoring parameters
§Returns
SearchResult containing matched files, scores, and location information
pub fn get_scan_progress(&self) -> ScanProgress
Sourcepub fn update_git_statuses(
&mut self,
status_cache: GitStatusCache,
shared_frecency: &SharedFrecency,
) -> Result<(), Error>
pub fn update_git_statuses( &mut self, status_cache: GitStatusCache, shared_frecency: &SharedFrecency, ) -> Result<(), Error>
Update git statuses for files, using the provided shared frecency tracker.
Sourcepub fn refresh_git_status(
shared_picker: &SharedPicker,
shared_frecency: &SharedFrecency,
) -> Result<usize, Error>
pub fn refresh_git_status( shared_picker: &SharedPicker, shared_frecency: &SharedFrecency, ) -> Result<usize, Error>
Refreshes git statuses using the provided shared picker and frecency handles.
pub fn update_single_file_frecency( &mut self, file_path: impl AsRef<Path>, frecency_tracker: &FrecencyTracker, ) -> Result<(), Error>
pub fn get_file_by_path(&self, path: impl AsRef<Path>) -> Option<&FileItem>
pub fn get_mut_file_by_path( &mut self, path: impl AsRef<Path>, ) -> Option<&mut FileItem>
Sourcepub fn add_file_sorted(&mut self, file: FileItem) -> Option<&FileItem>
pub fn add_file_sorted(&mut self, file: FileItem) -> Option<&FileItem>
Add a file to the picker’s files in sorted order (used by background watcher)
pub fn on_create_or_modify( &mut self, path: impl AsRef<Path> + Debug, ) -> Option<&FileItem>
pub fn remove_file_by_path(&mut self, path: impl AsRef<Path>) -> bool
pub fn remove_all_files_in_dir(&mut self, dir: impl AsRef<Path>) -> usize
Sourcepub fn cancel(&self)
pub fn cancel(&self)
We use this to prevent any substantial background threads from acquiring the locks
pub fn stop_background_monitor(&mut self)
pub fn trigger_rescan( &mut self, shared_frecency: &SharedFrecency, ) -> Result<(), Error>
pub fn is_scan_active(&self) -> bool
Sourcepub fn scan_signal(&self) -> Arc<AtomicBool> ⓘ
pub fn scan_signal(&self) -> Arc<AtomicBool> ⓘ
Return a clone of the scanning flag so callers can poll it without holding a lock on the picker.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FilePicker
impl !RefUnwindSafe for FilePicker
impl Send for FilePicker
impl Sync for FilePicker
impl Unpin for FilePicker
impl UnsafeUnpin for FilePicker
impl !UnwindSafe for FilePicker
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> 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