Skip to main content

Module binary

Module binary 

Source
Expand description

Optional binary payload support for high-frequency extension data.

The binary codec is intentionally additive. Existing JSON StbString payloads remain the compatibility format; callers opt into this module only after the host and extension have negotiated the binary capability. Payloads are length-bounded before decoding so this module is suitable for untrusted extension input when the caller also enforces the surrounding frame limit.

Structs§

BinaryOptions
Bounds applied to a binary payload before encoding or decoding.
StbBytes
An owned byte buffer that can cross an ABI boundary as pointer plus length.

Enums§

BinaryError
Error returned by the binary codec.

Constants§

DEFAULT_MAX_PAYLOAD_LENGTH
Default maximum encoded payload size (16 MiB).

Functions§

decode
Decode one typed value from a complete CBOR payload.
decode_json
Decode a binary payload into a JSON value without going through a UTF-8 string or JSON parser.
encode
Encode one typed value as a compact CBOR payload.
encode_json
JSON-shaped convenience API for tool and event payloads that are still represented by dynamic values at the product boundary.
free_bytes⚠
Default deallocator for buffers created by StbBytes::from_vec.

Type Aliases§

FreeBytesFn
Producer-side deallocator for StbBytes.