globset
Match file paths against glob patterns efficiently in Rust, supporting multiple patterns at once.
Official Documentation ↗v0.4. Check the official docs for the latest API surface.Installation
cargo add globsetMethods
No methods match this filter.
globset compiles glob patterns into matchers and sets for fast repeated matching.
Key Features
- Single and multi-pattern matching
- Compiled matchers for reuse
- Configurable literal separators
Usage Notes
Pin a version and check the official docs for the API surface you depend on before upgrading.
Errors
The following points are quoted verbatim from the official documentation. 来源:https://docs.rs/globset/latest/globset/ · 取证方式:HTTP GET 官方 README/文档页(HTML 去标签) · 抓取时间:2026-11-07T13:49:49.441Z. Any error type, throw condition or recovery step not stated there is left unspecified; this page does not infer exception classes or return values.
- Error Represents an error that can occur when parsing a glob pattern. (https://docs.rs/globset/latest/globset/)
- Enums § Error Kind The kind of error that can occur when parsing a glob pattern. (https://docs.rs/globset/latest/globset/)
Security notes
Quoted verbatim from the official documentation; this is not a complete threat model. 来源:https://docs.rs/globset/latest/globset/ · 取证方式:HTTP GET 官方 README/文档页(HTML 去标签) · 抓取时间:2026-11-07T13:49:49.441Z.
- When backslash escapes are enabled, a backslash ( \ ) will escape all meta characters in a glob. (https://docs.rs/globset/latest/globset/)
- Functions § escape Escape meta-characters within the given glob pattern. (https://docs.rs/globset/latest/globset/)
FAQ
- Why compile a matcher?
- Compilation parses the glob once; reusing the matcher avoids re-parsing for every path and is much faster.
- How does GlobSet differ from a list?
- A GlobSet matches all patterns in one pass and can report which pattern matched, which a manual loop cannot do efficiently.
- How are path separators handled?
- Matchers treat / as the separator by default; adjust lite settings if you need different semantics.
Report a problem with this API docOpens a pre-filled issue on GitHub.