masque_capsule (masque v0.7.0)

View Source

MASQUE capsule registry.

Capsules are reliable framed units carried on the CONNECT-UDP request/response stream body. The wire codec is the one from quic_h3_capsule (RFC 9297 section 3.2); this module adds a small registry identifying which capsule types MASQUE handles natively.

RFC 9297 section 3.3 requires unknown capsule types to be silently ignored by the receiver, so the default set below is intentionally empty - RFC 9298 does not define any mandatory capsules. Extension RFCs (compressed datagrams, QUIC-aware proxying) can be added here as the library grows.

Summary

Functions

Decode a single capsule from the head of Bin.

Encode a single capsule.

Returns true for capsule types MASQUE handles natively, and false for extension / unknown types (which must be silently ignored per RFC 9297 section 3.3).

Types

type/0

-type type() :: non_neg_integer().

value/0

-type value() :: binary().

Functions

decode(Bin)

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

Decode a single capsule from the head of Bin.

encode(Type, Value)

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

Encode a single capsule.

known(Type)

-spec known(type()) -> boolean().

Returns true for capsule types MASQUE handles natively, and false for extension / unknown types (which must be silently ignored per RFC 9297 section 3.3).