Skip to main content

Module path

Module path 

Source
Expand description

Path addressing for navigating state trees.

Paths use a JSON-path-like syntax: / → root node /nodes → “nodes” key in root map /nodes/0 → first element of “nodes” list /nodes/0/hostname → “hostname” key in first node object

Structs§

StatePath
A path into a state tree.

Enums§

PathComponent
A component of a path — either a map key or a list/set index.
PathError
Errors that can occur when parsing a path.

Constants§

MAX_PATH_DEPTH
Maximum number of path components accepted by StatePath::parse. Prevents pathological deeply-nested user input from blowing the stack or causing quadratic work in tree walkers.
MAX_SEGMENT_LEN
Maximum length (in bytes) of a single path segment accepted by StatePath::parse. Keys longer than this are almost always attacks or bugs — real keys are short identifiers.