Expand description
The patches that bring one tree to another, by key.
A tree sent over super is diffed against the copy the window holds, and the patches
alone are sent: a node kept by key keeps its widget, and with it focus, scroll position and
text state. Keyed by Node::key, which is stable for as long as the node shows the same
thing.
Both sides of the protocol use this: a tilolang view’s tree (crate::patch::Node) is
diffed by the runtime, and so is a Rust app’s — a view is a function of a resource whichever
language wrote it, and the window draws both the same way (one-app-model.md §2).
Functions§
- at
- The node at
path(keys below the root) ofnode, when each key on the way names one child. - at_mut
- The node at
path(keys below the root) ofnode. - diff
- The patches that bring
old, the tree the window holds, tonew, appended toout. - diff_at
- The patches that bring
old, the node atpathof the tree the window holds, tonew, appended toout;false, and nothing appended, whennewis another node (another kind or key) or its children’s keys are not unique: then the tree is diffed whole.