Skip to main content

Module transport

Module transport 

Source
Expand description

Out-of-band payloads for large image fields during model deserialization.

DocNode and ParagraphChildNode are untagged, so serde buffers each node into a generic tree before matching a variant. A JSON number array then costs one buffered value per image byte, repeated for every untagged level. Callers that already hold image bytes and data URIs can instead place them in TransportPayloads and write a short token in the JSON; the image field deserializers resolve the token, so only the token is buffered.

Image data also accepts a base64 string or the legacy number array, and src accepts any ordinary string.

Structs§

TransportPayloads
Large values referenced by tokens in model JSON.

Constants§

BYTES_TOKEN_PREFIX
Prefix of a token that refers to TransportPayloads::bytes.
TEXT_TOKEN_PREFIX
Prefix of a token that refers to TransportPayloads::text.

Functions§

deserialize_image_data
Deserializes optional image bytes from a byte array, base64 string or bytes token.
deserialize_optional_text
Deserializes an optional string that may be a text token.
with_transport_payloads
Runs parse with payloads available to token-aware image fields.