glob
Support for matching file paths against Unix shell-style glob patterns in Rust.
Repository Health
Technical Analysis
glob is a small, foundational Rust crate maintained by the Rust Project that implements Unix shell-style wildcard pattern matching (*, ?, [...], **) against file paths. Its glob() function walks the filesystem and returns an iterator of paths matching a given pattern, while Pattern exposes the underlying matcher for testing strings against a glob pattern without touching the filesystem at all.
Despite its small surface area, glob is one of the most widely depended-upon crates in the Rust ecosystem (500M+ total downloads) because it’s the standard building block any Rust tool uses when it needs to accept *.txt-style patterns from users — build tools, linters, test runners, and CLI utilities that need to expand wildcard arguments into concrete file lists.
What You Get
- A
glob()function returning an iterator of filesystem paths matching a shell-style pattern - Support for
*,?,[...], and**(recursive directory) wildcard syntax - A standalone
Patterntype for matching arbitrary strings against a glob pattern without touching the filesystem - Case-insensitive and other configurable matching options via
MatchOptions - Long-term API stability as a Rust Project-maintained crate with minimal dependencies
Common Use Cases
- Expanding wildcard file arguments (e.g.
*.rs,src/**/*.toml) passed to a CLI tool into a concrete file list - Build tools and code generators that need to discover source files matching a pattern
- Linters and formatters that accept include/exclude glob patterns for file selection
- Test runners that discover test files via glob patterns
- Validating whether a given string matches a user-supplied wildcard pattern without hitting the filesystem
Under The Hood
Architecture - The entire crate is implemented in a single src/lib.rs file (~1,500 lines), reflecting its narrow, focused scope: a Pattern struct compiles a glob string into an internal matcher representation, a glob() function combines that matcher with a std::fs::read_dir-based directory walker to lazily yield matching PathBufs as an iterator, and MatchOptions controls case sensitivity and other matching behavior. There’s no plugin system or extensibility layer — the crate deliberately does one thing.
Tech Stack - Pure Rust with zero runtime dependencies (only tempfile and doc-comment as dev-dependencies for testing), targeting Rust 1.63.0+ per Cargo.toml. This minimal dependency footprint is a deliberate design choice for a crate this foundational, since a large fraction of the Rust ecosystem depends on it transitively and any added dependency would multiply across thousands of downstream crates.
Code Quality - Tests live both inline in src/lib.rs (18 #[test] functions) and in a separate tests/glob-std.rs integration test file exercising filesystem-based globbing end to end. The repository includes a triagebot.toml for Rust Project issue-triage automation and a CHANGELOG.md tracking releases, consistent with other rust-lang-maintained crates. GitHub’s health signal shows infrequent maintenance activity, which is expected and appropriate for a mature, feature-complete utility crate rather than a sign of neglect.
API Design - The API is deliberately minimal: a single glob(pattern: &str) -> Result<Paths, PatternError> function covers the common case, while Pattern::new() and Pattern::matches() expose the matcher directly for callers who want to test strings without filesystem access. This two-function surface (plus MatchOptions for edge cases) makes the crate trivial to learn and reason about, at the cost of not supporting more advanced globbing semantics (e.g. brace expansion) that other ecosystems’ glob libraries provide.
Used by 14 apps in this directory
Pipedash
Developer Tools · Devops · Monitoring
One dashboard to monitor, trigger, and cancel CI/CD pipelines across GitHub, GitLab, Jenkins, Tekton, Buildkite, ArgoCD, and Bitbucket — desktop, Docker, or iOS.
PostgresML
AI Development · Databases
Run ML training and LLM inference natively inside PostgreSQL with GPU acceleration — no data movement required.
QuestDB
Analytics · Databases
A high-performance, open-source time-series database built for financial market data, IoT telemetry, and real-time analytics, combining a zero-GC Java/C++ core with SIMD-accelerated SQL and a WAL-to-Parquet storage engine.
Spacedrive
Collaboration · File Storage
One file manager for all your devices and clouds — powered by a Virtual Distributed File System built in Rust.
Temps
Analytics · Devops · Monitoring
A self-hosted Rust PaaS that replaces Vercel, Sentry, PostHog, Pingdom, Resend, and E2B with one binary — plus 440+ CLI operations agents like Claude Code can drive directly.