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§
- Content
Source - The game supplies a builder that validates its domain and constructs all replacement state. Returning Err preserves source, generation and live game.
- Reload
Failure - One retained failure; the diagnostic stores no failed source text or history.
- Reload
State - 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§
- Reload
Origin - Where a rejected reload originated.
- Reload
Stage - The boundary that rejected a reload, independent of the domain error kind.
- Reload
Status - 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_statebut preserve any pending edit. - reload_
state - Inspect reload state without advancing the game or consuming queued work.