mdquery-rs
A Rust binding library for macOS Spotlight search. Utilizes macOS Metadata Query API to perform efficient file searches.
Features
- Support for macOS Spotlight search queries
- Clean Rust API interface
- Support for various query conditions: file name, content type, modification time, file size, etc.
- Custom search scopes (home directory, entire computer, network, etc.)
- Builder pattern for constructing complex queries
- Complete error handling and type safety
System Requirements
- macOS operating system
- Rust 1.56.0 or higher
Installation
Add the dependency to your Cargo.toml
:
[]
= "0.1.0"
Usage Examples
Basic Usage
use ;
// Find PDF files in home directory with "document" in their name
let query = default
.name_like
.extension
.time
.build
.unwrap;
let results = query.execute.unwrap;
for item in results
Contributing
Contributions and issue reports are welcome!
License
MIT
Related Projects
- objc2 - Rust bindings to the Objective-C runtime and frameworks