Capsule
struct CapsuleImplements Copyable, Movable
- Fields
capsule_type: UInt64value: List[UInt8]
flare_mlake · API · http3
flare.http3.capsuleThe Capsule Protocol (RFC 9297 sec 3).
A capsule is type (varint) || length (varint) || value on the data
stream of a tunnel such as an extended CONNECT. Sans-I/O: the encoder
appends to a caller-owned buffer and the parser reads from the front of
one, returning None until a whole capsule is there.
Capsulestruct CapsuleImplements Copyable, Movable
capsule_type: UInt64value: List[UInt8]encode_capsuledef encode_capsule(capsule_type: UInt64, value: Span[UInt8], mut out: List[UInt8]) Append one capsule to out.
parse_capsuledef parse_capsule(buf: Span[UInt8], max_value: Int) -> Optional[Tuple[Capsule, Int]] The capsule at the front of buf and the bytes it spans, or None while it is incomplete. A value longer than max_value raises before any of it is buffered, so a peer cannot make the receiver hold an arbitrarily large capsule.
comptime CAPSULE_TYPE_DATAGRAM = UInt64(0)RFC 9297 sec 3.5: an HTTP Datagram carried on the stream.