Module content

Source
Expand description

Optional authoring bridge. A Source polls only explicit local files or queued browser edits; ordinary frames do no filesystem work or source allocation.

reload_state inspects the calling thread’s bridge without consuming edits. The bridge serves one selected document: constructing a ContentSource selects it and resets its diagnostics. Poll that source on the same thread as queue and inspection. The existing Wasm status codes/exports are unchanged.

Structs§

ContentSource
The game supplies a builder that validates its domain and constructs all replacement state. Returning Err preserves source, generation and live game.
ReloadFailure
One retained failure; the diagnostic stores no failed source text or history.
ReloadState
An owned diagnostic snapshot of the calling thread’s selected document. Source text is not copied. Inspection allocates only to clone retained error context when a failure is present; it never reads a file or consumes an edit.

Enums§

ReloadOrigin
Where a rejected reload originated.
ReloadStage
The boundary that rejected a reload, independent of the domain error kind.
ReloadStatus
Latest bridge operation, using the existing browser status codes.

Constants§

MAX_RELOAD_CONTEXT_BYTES
Maximum UTF-8 bytes retained in a reload failure’s error context.

Functions§

queue
Queue a single edit; newer unapplied edits replace older ones. Parsing/game validation remains in the game, on its next poll. UTF-8 and size are checked. Rejected submissions update reload_state but preserve any pending edit.
reload_state
Inspect reload state without advancing the game or consuming queued work.