glob

Support for matching file paths against Unix shell-style glob patterns in Rust.

Library
Cargo
v0.3.4
596 stars
MIT OR Apache-2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
57 /100 Fair
Development Activity 48
Maintenance 24
Community 76
Maturity 60
Momentum 20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
74 /100 Good
Architecture 72
Code Quality 78
Innovation 55
Learning Curve 90

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 Pattern type 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

Rust
76%
GPL 3.0

Pipedash

Developer Tools · Devops · Monitoring

1,103

One dashboard to monitor, trigger, and cancel CI/CD pipelines across GitHub, GitLab, Jenkins, Tekton, Buildkite, ArgoCD, and Bitbucket — desktop, Docker, or iOS.

View details
80
Repo Health
64
Technical
73
Dependency
Built with
Rust 76%
TypeScript 24%
Updated 5 days ago
Rust
63%
MIT

PostgresML

AI Development · Databases

6,823

Run ML training and LLM inference natively inside PostgreSQL with GPU acceleration — no data movement required.

View details
51
Repo Health
76
Technical
64
Dependency
Built with
Rust 63%
JavaScript 11%
Updated 1 years ago
Java
93%
Apache 2.0

QuestDB

Analytics · Databases

17,466

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.

View details
91
Repo Health
86
Technical
67
Dependency
Built with
Java 93%
Updated 5 days ago
Rust
79%
AGPL 3.0

Spacedrive

Collaboration · File Storage

39,292

One file manager for all your devices and clouds — powered by a Virtual Distributed File System built in Rust.

View details
84
Repo Health
84
Technical
63
Dependency
Built with
Rust 79%
TypeScript 18%
Updated 2 weeks ago
Rust
66%
Apache 2.0

Temps

Analytics · Devops · Monitoring

865

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.

View details
81
Repo Health
86
Technical
66
Dependency
Built with
Rust 66%
TypeScript 33%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers