flare_mlake · API

flare.http3

flare.http3 — sans-I/O HTTP/3 codec primitives (RFC 9114).

HTTP/3 maps onto QUIC streams: each request lives on its own bidirectional stream, and the application data is a sequence of type-length-payload framed messages defined in RFC 9114 §7.

This package ships the codec layer of HTTP/3: pure byte-in / byte-out parsers and emitters for frames. The QUIC stream layer (reactor + flow control) and the header-block decoder (QPACK) are deliberately separate modules; this package depends only on the varint codec in :mod:flare.quic.varint.

Public re-exports:

  • :class:Http3Frame, :class:Http3FrameType — the parsed-frame carrier + named frame-type constants.
  • :func:encode_http3_frame, :func:decode_http3_frame — byte-level codec helpers.
  • :func:decode_http3_settings, :func:encode_http3_settings — the HTTP/3 SETTINGS frame payload codec (a list of identifier: value varint pairs, RFC 9114 §7.2.4).
  • :class:Http3RequestReader + :trait:Http3RequestEventHandler + :func:feed_into[H] — sans-I/O state machine that consumes the request-stream byte stream and fires typed callbacks (on_headers / on_data / on_trailers / on_unknown_frame / on_protocol_error) per RFC 9114 §4. The H3_REQUEST_STATE_* constants enumerate the reader's lifecycle states.
  • :func:encode_response_headers, :func:encode_response_data, :func:encode_response_trailers — sans-I/O response-stream writer that emits the corresponding HTTP/3 frames (HEADERS, DATA, TRAILERS) with QPACK-encoded field sections, ASCII header-name lowercasing, and pseudo-header validation per RFC 9114 §4.
  • :func:encode_request_headers, :func:encode_request_data, :func:encode_request_trailers, :func:encode_client_control_stream, and the QPACK uni-stream preamble encoders — the client-side request writer (mirror of the response writer) plus the unidirectional control / QPACK stream preambles (RFC 9114 §6.2).
  • :class:Http3ResponseReader + :class:Http3Response — the stateful client-side response decoder that accumulates HEADERS / DATA / trailers into an assembled response (mirror of the request reader).