pub struct IsolatedSceneMetadata { /* private fields */ }Expand description
The [take_store]/[restore_store] bracket as an RAII guard, for
OUT-OF-CRATE producers that build a payload against a LIVE document.
The hazard it exists for: crate::snapshot_solids captures whatever record
the thread’s store holds for each name it is sealing. That is exactly right
for a snapshot of the CURRENT scene (a face’s material rides along), and
exactly WRONG for a payload built out of freshly-named solids that were never
in this scene — the STEP-assembly import lane’s per-part
crate::native_import_payload call being the first such producer. There,
any collision between the names being stamped and names already in the
document’s store would silently seal the CURRENT document’s metadata into the
new part. Holding this guard across the encode makes the payload a pure
function of its solids, which is what its determinism claim assumes.
Scope it to the ENCODE only. Anything that runs a history — the display
rebuild, a pump — stamps records the document must keep, and dropping the
guard afterwards would throw exactly those away.
Restores on drop, panics included; nesting is harmless (the inner guard takes an already-empty store and restores it).