Skip to main content

Crate structfs_path_validation

Crate structfs_path_validation 

Source
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 one XID_Continue char; remaining chars are XID_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.