quic_h3_capsule (quic v1.3.0)
View SourceSummary
Types
-type capsule_type() :: non_neg_integer().
-type capsule_value() :: binary().
Functions
-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.
-spec encode(capsule_type(), iodata()) -> iodata().
Encode a capsule as an iolist.