quic_h3_capsule (quic v1.3.0)

View Source

Summary

Functions

Decode a single capsule from the head of a binary.

Encode a capsule as an iolist.

Types

capsule_type/0

-type capsule_type() :: non_neg_integer().

capsule_value/0

-type capsule_value() :: binary().

Functions

decode(Bin)

-spec decode(binary()) ->
                {ok, {capsule_type(), capsule_value(), binary()}} |
                {more, non_neg_integer()} |
                {error, term()}.

Decode a single capsule from the head of a binary.

Returns {ok, {Type, Value, Rest}} when a complete capsule is available; {more, Needed} (a non-negative hint that may be 1 when the length is unknown) if more bytes are needed; {error, Reason} on a malformed varint.

encode(Type, Value)

-spec encode(capsule_type(), iodata()) -> iodata().

Encode a capsule as an iolist.