Expand description
The canonical StructFS path component grammar.
This crate exists so that everything that validates path components —
structfs-core-store at runtime and structfs-path-macro at compile
time — shares one implementation. A forked grammar can drift; a shared
one cannot.
§Grammar
A path component is one of:
- A pure numeric string (
0,42) — used for array indexing. - A Unicode identifier per UAX#31: first char is
XID_Start, or an underscore followed by at least oneXID_Continuechar; remaining chars areXID_Continue.
Empty components, bare _, and components containing /, -, spaces,
or other punctuation are invalid. Arbitrary strings can be made valid
with Namecode encoding (see PathComponent::encode in core-store).
Functions§
- validate_
component - Validate a single path component against the StructFS grammar.