Skip to main content

Module path

Module path 

Source
Expand description

One value-addressing primitive over Expr.

A path is a sequence of segments: a map key or a sequence index. The wire form of a segment is Vector([sym("k"), key]) for a map key or Vector([sym("i"), text(index)]) for a sequence index – exactly the form the scene differ and the universal editor already emit, so this is a drop-in for all three previous copies. set_at/remove_at are immutable.

Structs§

Path
A path from a root value to a nested value.

Enums§

PathError
A failure navigating or editing along a path.
Segment
One step of a path: into a map by key, or into a sequence by index.

Functions§

get
Borrow the value at path, if present.
remove_at
Remove the value at path (the final segment must be a map key), in a new root value.
set_at
Set the value at path, preserving every sibling, in a new root value. A missing intermediate key or out-of-range index is an error.