moonbitstack/moonhttp/http2 does not have a README file

    Refused

    pub(all) suberror Refused {
    Incomplete
    FrameSizeError(String)
    ProtocolError(String)
    } derive(Eq)

    A raised decode failure. Incomplete is the normal "need more bytes" signal a streaming reader catches to wait for the rest; the others are protocol errors.
    impl Show for Refused

    Refused::equal

    fn Refused::equal(Refused, Refused) -> Bool

    Refused::not_equal

    fn Refused::not_equal(x : Refused, y : Refused) -> Bool

    Refused::output

    fn Refused::output(self : Refused, logger : &Logger) -> Unit

    Refused::to_string

    fn Refused::to_string(self : Refused) -> String

    Frame

    pub(all) enum Frame {
    Data(stream_id~ : Int, data~ : Bytes, end_stream~ : Bool, padding~ : Int)
    Headers(stream_id~ : Int, fragment~ : Bytes, end_stream~ : Bool, end_headers~ : Bool, priority~ : Priority?, padding~ : Int)
    Priority(stream_id~ : Int, priority~ : Priority)
    RstStream(stream_id~ : Int, error_code~ : Int)
    Settings(params~ : Array[(Int, Int)], ack~ : Bool)
    PushPromise(stream_id~ : Int, promised_id~ : Int, fragment~ : Bytes, end_headers~ : Bool, padding~ : Int)
    Ping(payload~ : Bytes, ack~ : Bool)
    GoAway(last_stream_id~ : Int, error_code~ : Int, debug~ : Bytes)
    WindowUpdate(stream_id~ : Int, increment~ : Int)
    Continuation(stream_id~ : Int, fragment~ : Bytes, end_headers~ : Bool)
    Unknown(ftype~ : Int, flags~ : Int, stream_id~ : Int, payload~ : Bytes)
    } derive(Eq)

    A decoded HTTP/2 frame (RFC 9113 §6). Each variant carries the semantic payload with padding already stripped; padding is the number of padding bytes to (re)emit. Unknown preserves extension/unrecognised frames verbatim so a reader can forward or ignore them (RFC 9113 §4.1).

    Frame::code

    fn Frame::code(self : Frame) -> Int

    The numeric frame-type code of this frame (RFC 9113 §6).

    Frame::encode

    fn Frame::encode(self : Frame) -> Bytes

    Encode this frame to its complete wire representation (9-octet header + payload), the exact inverse of decode_frame.

    Frame::equal

    fn Frame::equal(Frame, Frame) -> Bool

    Frame::not_equal

    fn Frame::not_equal(x : Frame, y : Frame) -> Bool

    FrameHeader

    pub(all) struct FrameHeader {
    length : Int
    ftype : Int
    flags : Int
    stream_id : Int
    } derive(Eq)

    The fixed 9-octet frame header (RFC 9113 §4.1): a 24-bit payload length, an 8-bit type, 8-bit flags, a reserved bit, and a 31-bit stream identifier.

    FrameHeader::decode

    fn FrameHeader::decode(data : Bytes, offset? : Int) -> FrameHeader raise Refused

    Decode the 9-octet frame header at offset. Raises Incomplete when fewer than 9 octets are available. The reserved bit is masked off the stream id.

    FrameHeader::encode

    fn FrameHeader::encode(self : FrameHeader) -> Bytes

    Encode a FrameHeader to its 9 wire octets.

    FrameHeader::equal

    fn FrameHeader::equal(FrameHeader, FrameHeader) -> Bool

    FrameHeader::not_equal

    fn FrameHeader::not_equal(x : FrameHeader, y : FrameHeader) -> Bool

    Priority

    pub(all) struct Priority {
    exclusive : Bool
    stream_dependency : Int
    weight : Int
    } derive(Eq)

    The stream-priority block shared by PRIORITY frames and the optional priority section of HEADERS (RFC 9113 §5.3.2). weight is the raw wire byte (0..255); the effective priority weight is weight + 1 (§6.3).

    Priority::equal

    fn Priority::equal(Priority, Priority) -> Bool

    Priority::not_equal

    fn Priority::not_equal(x : Priority, y : Priority) -> Bool

    decode

    fn decode(data : Bytes, offset? : Int) -> (Frame, Int) raise Refused

    Decode exactly one frame at offset, returning (frame, bytes_consumed) where bytes_consumed is 9 + payload_length. Raises Incomplete when the buffer does not yet hold the whole frame, or a protocol error when the payload is malformed for its type. The inverse of Frame::encode.

    error_cancel

    let error_cancel : Int

    CANCEL: the stream is no longer wanted.

    error_compression_error

    let error_compression_error : Int

    COMPRESSION_ERROR: the HPACK context is corrupt, which kills the connection.

    error_connect_error

    let error_connect_error : Int

    CONNECT_ERROR: the TCP connection behind a CONNECT stream failed.

    error_enhance_your_calm

    let error_enhance_your_calm : Int

    ENHANCE_YOUR_CALM: the peer is generating too much load.

    error_flow_control_error

    let error_flow_control_error : Int

    FLOW_CONTROL_ERROR: the peer sent more than its credit allowed.

    error_frame_size_error

    let error_frame_size_error : Int

    FRAME_SIZE_ERROR: the frame's length is invalid for its type.

    error_http_1_1_required

    let error_http_1_1_required : Int

    HTTP_1_1_REQUIRED: the request cannot be served over HTTP/2.

    error_inadequate_security

    let error_inadequate_security : Int

    INADEQUATE_SECURITY: the transport does not meet the minimum this endpoint requires.

    error_internal_error

    let error_internal_error : Int

    INTERNAL_ERROR: the endpoint failed for reasons of its own.

    error_no_error

    let error_no_error : Int

    HTTP/2 error codes (RFC 9113 §7), carried by RST_STREAM and GOAWAY.

    error_protocol_error

    let error_protocol_error : Int

    PROTOCOL_ERROR: the peer broke the protocol in a way not covered below.

    error_refused_stream

    let error_refused_stream : Int

    REFUSED_STREAM: the stream was declined before any processing, so it is safe to retry.

    error_settings_timeout

    let error_settings_timeout : Int

    SETTINGS_TIMEOUT: a SETTINGS frame went unacknowledged too long.

    error_stream_closed

    let error_stream_closed : Int

    STREAM_CLOSED: a frame arrived for a stream that was already finished.

    flag_ack

    let flag_ack : Int

    ACK on SETTINGS and PING shares bit 0x1 with END_STREAM.

    flag_end_headers

    let flag_end_headers : Int

    END_HEADERS: no CONTINUATION follows this header block.

    flag_end_stream

    let flag_end_stream : Int

    HTTP/2 frame flags (RFC 9113 §6). Flags are type-specific; the same bit carries different meaning per frame type, hence the shared numeric values.

    flag_padded

    let flag_padded : Int

    PADDED: a length byte and that many padding bytes wrap the payload.

    flag_priority

    let flag_priority : Int

    PRIORITY: this HEADERS frame carries a stream-dependency block.

    frame_continuation

    let frame_continuation : Int

    CONTINUATION: the rest of a header block too large for one frame.

    frame_data

    let frame_data : Int

    HTTP/2 frame type codes (RFC 9113 §6).

    frame_goaway

    let frame_goaway : Int

    GOAWAY: stop opening streams, and here is the last id I accepted.

    frame_headers

    let frame_headers : Int

    HEADERS: opens a stream and carries its HPACK header block.

    frame_ping

    let frame_ping : Int

    PING: the round-trip probe keepalive is built on.

    frame_priority

    let frame_priority : Int

    PRIORITY: the deprecated stream-dependency hint; accepted and ignored.

    frame_push_promise

    let frame_push_promise : Int

    PUSH_PROMISE: server push, which gRPC never uses.

    frame_rst_stream

    let frame_rst_stream : Int

    RST_STREAM: abort one stream without touching the connection.

    frame_settings

    let frame_settings : Int

    SETTINGS: the connection parameters each peer announces, and their ack.

    frame_window_update

    let frame_window_update : Int

    WINDOW_UPDATE: hand the peer more flow-control credit.

    has_preface

    fn has_preface(data : Bytes) -> Bool

    Whether data begins with the exact 24-octet HTTP/2 connection preface.

    preface

    let preface : Bytes

    The HTTP/2 client connection preface (RFC 9113 §3.5): the fixed, case-sensitive 24-octet sequence PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n a client sends before its first frame, which must be a SETTINGS frame. Its bytes deliberately form a malformed HTTP/1.1 request so an HTTP/1.1-only server rejects it cleanly.

    settings_enable_push

    let settings_enable_push : Int

    SETTINGS_ENABLE_PUSH: whether the peer may send PUSH_PROMISE.

    settings_header_table_size

    let settings_header_table_size : Int

    SETTINGS parameter identifiers (RFC 9113 §6.5.2).

    settings_initial_window_size

    let settings_initial_window_size : Int

    SETTINGS_INITIAL_WINDOW_SIZE: the flow-control credit a new stream starts with.

    settings_max_concurrent_streams

    let settings_max_concurrent_streams : Int

    SETTINGS_MAX_CONCURRENT_STREAMS: how many streams may be open at once.

    settings_max_frame_size

    let settings_max_frame_size : Int

    SETTINGS_MAX_FRAME_SIZE: the largest payload the peer will accept in one frame.

    settings_max_header_list_size

    let settings_max_header_list_size : Int

    SETTINGS_MAX_HEADER_LIST_SIZE: the advisory ceiling on a decoded header list.

    Source Files