Rust Search / RUST
File search that fits your Rust code.
Rust Search is a file-search library for Rust applications. Configure locations and filters with SearchBuilder, collect matching paths, and use them in your own application.
use rust_search::SearchBuilder;
let files: Vec<String> = SearchBuilder::default()
.location("./src")
.ext("rs")
.build()
.collect();Compose a search
SearchBuilder lets you describe where to search and which files to return. The repository documents options for multiple locations, search text, extensions, case handling, depth and result limits. Use a small query for a simple task and add filters as the application needs them.
Control the work
The current source also documents excluding expensive directories, respecting or disabling gitignore rules, and adding filters for file size or timestamps. Custom filters can capture values from their environment. Consult the documentation for the crate version in your project before relying on a particular option.
Read benchmarks with their context
The published README reports a 17.25× difference versus Glob on a 300,000-file dataset, measured on an M2 MacBook Air with 16 GB of memory. Its separate comparison with fd uses a 45,000-file dataset. These are historical measurements of different workloads, not a promise that every search will run at the same relative speed.
Use it in your project
Rust Search is published as rust_search on crates.io under the MIT license. The GitHub repository holds the source, examples and benchmark notes; docs.rs provides versioned API documentation. Report reproducible issues or contribute improvements through the repository.