Skip to main content

Module wire

Module wire 

Source
Expand description

Leptos-free wire types spoken between a page and its render worker, compiled under either the leptos or the offscreen feature. Pixel quantities are physical surface pixels (CSS pixels times the device pixel ratio), origin at the canvas top-left.

ToWorker and FromWorker are the control plane the host owns: init, resize, input, picking, and status. Application traffic rides a separate envelope field as the message pair a WorkerProtocol impl declares, with optional binary Attachments transferred alongside.

Structs§

SelectedEntity
The selected entity as reported to the page: display data only. The worker keeps the live selection and hands it to the custom message handler; nothing here resolves back into an entity.
ValueProtocol
The untyped protocol: JSON values both ways. What run_offscreen and the default use_engine speak, so a small app never declares message enums.

Enums§

FromWorker
ToWorker
TouchPhase

Constants§

APP_KEY
Envelope field carrying a serialized application message: the WorkerProtocol::Incoming type page to worker, the WorkerProtocol::Outgoing type worker to page.
ATTACHMENTS_KEY
Envelope field carrying named binary payloads as a { name: Uint8Array } object whose buffers ride the transfer list.
CANVAS_KEY
Envelope field carrying the transferred OffscreenCanvas (on Init only).
MESSAGE_KEY
Envelope field carrying the serialized control message in every postMessage.

Traits§

WorkerProtocol
The application message pair a page and its worker speak over the APP_KEY envelope field, from the worker’s point of view: Incoming arrives from the page, Outgoing returns to it. The control plane (init, resize, input, picking, status) is not part of the protocol; the host owns it. Both types serialize and deserialize because each crosses the wire in one direction and is decoded on the other side.

Type Aliases§

Attachments
Named binary payloads accompanying an application message: dropped asset bytes, a glTF with its resources, a saved file.