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§
- Transport
Payloads - 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
parsewithpayloadsavailable to token-aware image fields.