Skip to main content

Module transfer

Module transfer 

Source
Expand description

Envelope encoding shared by the page and the worker: every postMessage is a plain object whose fields are the crate::wire::MESSAGE_KEY control message or the crate::wire::APP_KEY application message, plus optional crate::wire::ATTACHMENTS_KEY binary payloads whose buffers ride the transfer list.

Functionsยง

app_value_from
Decodes the application message riding data, if any.
attach
Adds named binary payloads to envelope and their buffers to transfer. Returns false when the attachment bag could not be written.
attachments_from
Decodes the named binary attachments riding data, empty when none did.
control_value_from
Decodes the control message riding data, if any.
envelope_with
Builds an envelope carrying message under key, or None when the message does not serialize.