Skip to main content

Module variables

Module variables 

Source
Expand description

Variables: the small ordered map of named values a node produces and a pool namespace holds.

A node’s outputs become its namespace in the variable pool and travel in its Event::NodeSucceeded unchanged: Variables is a reference-counted handle, so storing the outputs, emitting them and taking pool snapshots share one allocation instead of copying the map. Writes copy the entries only while they are shared (copy-on-write).

Nodes produce a handful of variables, so entries are kept in insertion order in a flat vector (the first few stored inline in the shared allocation) and looked up by a linear scan, which beats hashing at these sizes. Names are VarNames, which hold a &'static str without allocating.

Structs§

IntoIter
Owning iterator over a Variables map (copies the entries if shared).
Iter
Borrowing iterator over a Variables map.
VarName
Name of a variable in a Variables map.
Variables
Ordered map of variable names to values, shared on clone.