Skip to main content

Module block_model

Module block_model 

Source
Expand description

The block model: entities and namespaces of the document. Rationale: docs/doc-ng-design-notes.md.

Modules§

payload 🔒
Serde has no Arc<[u8]> without its rc feature, and reading is deliberately wider than writing: a binary format hands over a byte string, a text format hands over the spelling its variant writes, and either may also arrive as the array of numbers written by builds before this was format-aware.
png_payload 🔒
A PNG payload in a format a human reads: standard-alphabet base64 with padding (RFC 4648 §4, A–Z a–z 0–9 + /, =-padded), since the bytes are not text.
svg_payload 🔒
An SVG payload in a format a human reads: its own source text, verbatim, so the document stays greppable and an artwork diff reads as the drawing it is. Every construction site builds one from a String (crate::block_model::Asset’s callers read SVG as text), so the bytes are UTF-8 and the encode cannot fail in practice.

Structs§

Area
Block
Icon
One atomic value on its block; the zero icon (null hash, empty rect) means “no image”.
Image
A free-floating placed image (block icons are the atomic Icon value).
Label
A namespace of four independent registers — no id, no lifecycle.
Pin
Route
RouteLabel
Text

Enums§

AreaUpdate
Asset
Arc: crosses the sync thread boundary.
BlockUpdate
ImageUpdate
LabelUpdate
PinUpdate
RouteLabelUpdate
RouteUpdate
TextUpdate

Constants§

ASSET_LIMIT
The largest artwork payload a commit may carry. A payload is create-only and the document holds every one it has ever been given, so an unbounded one is unbounded forever: it is folded again on every open. Four megabytes is generous for a diagram symbol and small enough that a stray photograph is refused rather than archived.