Skip to main content

Module wire

Module wire 

Source
Expand description

Scenes on the wire: a scene to its proto::Scene and back; the patch between two scenes is patch’s. Each image file and font file travels once: a scene carries every one its nodes use, a patch only those the scene before it didn’t have.

Structs§

Applied
What a patch did, by id, for a drawing kept beside the scene to follow: the subtrees that left their place — removed, or moved away — the subtrees placed — inserted, or moved here — and the nodes that kept their place and took new own attributes, with the ones they had.
Uses
How many nodes of a scene show each image file and are set in each font file: what lets a patch drop the files no node uses any more without walking the scene.

Enums§

Edit
One operation of a patch, on the engine’s own nodes: what the wire carries as a proto::Op, and what a scene kept beside a resolve is brought across by without its nodes passing through the wire’s form.

Functions§

apply
Applies a patch to scene, whose files uses counts, or says why it can’t — leaving both as they were. The work is the patch’s: each operation finds its nodes by id, and the files no node uses any more are dropped by count, never by a walk of the scene.
apply_edits
Applies edits to scene, whose files uses counts, with the image and font files they may need — or says why it can’t, leaving both as they were. The work is the edits’: each finds its nodes by id.
bring
Brings scene, whose files uses counts, to to’s content by the patch between them — its nodes keeping their places, so what is kept beside it can follow — with to’s image and font files as they are, never through the wire’s bytes.
decode
A node from the wire, or why it isn’t one.
decode_scene
The scene a stream message carries; image and font files held already has aren’t decoded or checked again.
edits
The operations from old to new. Each node of new that old has is kept — moved if it has another parent or falls out of the longest run of siblings still in their order, and changed if its own attributes did; each one old hasn’t is inserted, whole where nothing under it is kept, alone where something is, which is then moved into it. Last, what old has and new doesn’t goes: by then nothing kept is under it.
encode
encode_edits
Edits in the wire’s form.
encode_own
A node’s own attributes for the wire: its children aside.
patch
The patch that turns old, as last sent, into new, by their nodes’ ids: an insert before the first of 100,000 siblings is one insert. And the image and font files old didn’t have.
scene
A whole scene for the wire: its tree and every image file it shows.
subtree
The edits that turn the subtree of old at at — whose root has the id new’s root has — into new: what a part of a scene resolved again is brought across by, costing that part alone.