Skip to main content

Module http2

Module http2 

Source
Expand description

Pure-Rust HTTP/2 Framing, HPACK Header Compression, and Client Protocol Engine (RFC 7540, RFC 7541, RFC 9113).

Structs§

FlowControlWindow
Manages RFC 7540 §5.2 flow control window tracking and updates.
HpackDecoder
Stateful HPACK decoder maintaining dynamic table per RFC 7541.
Http2ConnectionSettings
Active HTTP/2 connection settings negotiated across the lifetime of the connection.
Http2Frame
An individual HTTP/2 protocol frame.

Enums§

Http2ErrorCode
RFC 7540 Section 7 HTTP/2 Error Codes.

Constants§

ABSOLUTE_MAX_FRAME_SIZE
Absolute maximum allowable frame size per RFC 7540 Section 4.1 (16,777,215 octets / 2^24 - 1).
DEFAULT_MAX_FRAME_SIZE
Default initial maximum frame size per RFC 7540 Section 6.5.2 (16,384 octets / 2^14).
FLAG_ACK
FLAG_END_HEADERS
FLAG_END_STREAM
FLAG_PADDED
FLAG_PRIORITY
FRAME_CONTINUATION
FRAME_DATA
FRAME_GOAWAY
FRAME_HEADERS
FRAME_HEADER_LEN
Frame header length in octets (24-bit length + 8-bit type + 8-bit flags + 31-bit stream ID).
FRAME_PING
FRAME_PRIORITY
FRAME_PUSH_PROMISE
FRAME_RST_STREAM
FRAME_SETTINGS
FRAME_WINDOW_UPDATE
HTTP2_PREFACE
HTTP/2 Connection Preface sent by the client upon connection establishment.
SETTINGS_ENABLE_PUSH
SETTINGS_HEADER_TABLE_SIZE
SETTINGS_INITIAL_WINDOW_SIZE
SETTINGS_MAX_CONCURRENT_STREAMS
SETTINGS_MAX_FRAME_SIZE
SETTINGS_MAX_HEADER_LIST_SIZE
STATIC_TABLE

Functions§

decode_hpack_headers
Convenience function to decode HPACK headers with a clean ephemeral decoder.
decode_huffman_string
Decodes an HPACK Huffman-encoded octet slice into a UTF-8 string per RFC 7541 Section 5.2.
decode_integer
Decodes an integer from a byte slice with a given prefix size per RFC 7541 Section 5.1.
decode_string_literal
Decodes an HPACK string literal starting at cursor, supporting both plain and Huffman encoding.
encode_hpack_headers
Encodes a list of header key-value pairs into an HPACK header block.
encode_integer
Encodes an integer into a byte vector with a given prefix size per RFC 7541 Section 5.1.
encode_string_literal
Encodes a string literal into an HPACK octet sequence (uncompressed literal, H=0).
execute_http2_request
Executes a full HTTP/2 request cycle over a synchronous stream (Plain TCP or TLS).