Skip to main content

fastgrep/
lib.rs

1//! Fastgrep — a parallel grep implementation with trigram indexing.
2//!
3//! Provides a GNU grep-compatible interface that runs searches across
4//! all available CPU threads. Builds a trigram content index on first
5//! run to accelerate subsequent searches for any pattern.
6//!
7//! # Example
8//!
9//! ```no_run
10//! use clap::Parser;
11//! use fastgrep::cli::Cli;
12//! use fastgrep::pattern::CompiledPattern;
13//! use fastgrep::searcher::search_file;
14//!
15//! let cli = Cli::parse();
16//! let config = cli.resolve();
17//! let pattern = CompiledPattern::compile(&config).unwrap();
18//! let result = search_file(config.paths[0].as_path(), &pattern, false, true, false).unwrap();
19//! println!("found {} matches", result.matches.len());
20//! ```
21
22pub mod cli;
23pub mod output;
24pub mod pattern;
25pub mod searcher;
26pub mod threadpool;
27pub mod trigram;
28pub mod walker;