API Reference

globset

Match file paths against glob patterns efficiently in Rust, supporting multiple patterns at once.

Official Documentation ↗
CompatibilityThis documentation covers version v0.4. Check the official docs for the latest API surface.

Installation

cargocargo add globset

Methods

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.

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.

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.