Skip to main content

fff_search/
lib.rs

1//! fff-core - High-performance file finder library
2//!
3//! This crate provides the core file indexing and fuzzy search functionality.
4//!
5//! # State management
6//!
7//! All state is instance-based. Callers create their own `SharedPicker` /
8//! `SharedFrecency` / `SharedQueryTracker` and pass them into
9//! `FilePicker::new_with_shared_state`. Multiple independent instances can
10//! coexist in the same process.
11
12mod background_watcher;
13pub mod constraints;
14mod db_healthcheck;
15mod error;
16pub mod file_picker;
17pub mod frecency;
18pub mod git;
19pub mod grep;
20pub mod log;
21pub mod path_utils;
22pub mod query_tracker;
23pub mod score;
24mod sort_buffer;
25pub mod types;
26
27use file_picker::FilePicker;
28use frecency::FrecencyTracker;
29use query_tracker::QueryTracker;
30use std::sync::{Arc, RwLock};
31
32pub type SharedPicker = Arc<RwLock<Option<FilePicker>>>;
33pub type SharedFrecency = Arc<RwLock<Option<FrecencyTracker>>>;
34pub type SharedQueryTracker = Arc<RwLock<Option<QueryTracker>>>;
35
36pub use db_healthcheck::{DbHealth, DbHealthChecker};
37pub use error::{Error, Result};
38pub use fff_query_parser::{
39    Constraint, FFFQuery, FuzzyQuery, Location, QueryParser, location::parse_location,
40};
41pub use file_picker::{FFFMode, FuzzySearchOptions, ScanProgress};
42pub use grep::{
43    GrepMatch, GrepMode, GrepResult, GrepSearchOptions, has_regex_metacharacters,
44    is_definition_line, is_import_line, multi_grep_search,
45};
46pub use types::{FileItem, PaginationArgs, Score, ScoringContext, SearchResult};