moonbitstack/moonquic/frame does not have a README file

    Refused

    pub(all) suberror Refused {
    Malformed(String)
    } derive(Eq)

    A malformed ACK frame: its fields do not describe a packet-number set.
    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 {
    Padding(Int)
    Ping
    Crypto(offset~ : UInt64, data~ : Bytes)
    Stream(id~ : UInt64, offset~ : UInt64, fin~ : Bool, data~ : Bytes)
    Ack(largest~ : UInt64, delay~ : UInt64, first_range~ : UInt64, ranges~ : Array[(UInt64, UInt64)])
    AckEcn(largest~ : UInt64, delay~ : UInt64, first_range~ : UInt64, ranges~ : Array[(UInt64, UInt64)], ect0~ : UInt64, ect1~ : UInt64, ce~ : UInt64)
    ResetStream(id~ : UInt64, error_code~ : UInt64, final_size~ : UInt64)
    StopSending(id~ : UInt64, error_code~ : UInt64)
    NewToken(token~ : Bytes)
    MaxData(UInt64)
    MaxStreamData(id~ : UInt64, max~ : UInt64)
    MaxStreams(bidi~ : Bool, max~ : UInt64)
    DataBlocked(UInt64)
    StreamDataBlocked(id~ : UInt64, max~ : UInt64)
    StreamsBlocked(bidi~ : Bool, max~ : UInt64)
    NewConnectionId(seq~ : UInt64, retire_prior_to~ : UInt64, conn_id~ : Bytes, reset_token~ : Bytes)
    RetireConnectionId(UInt64)
    PathChallenge(Bytes)
    PathResponse(Bytes)
    HandshakeDone
    ConnectionClose(error_code~ : UInt64, frame_type~ : UInt64?, reason~ : Bytes)
    } derive(Eq,
    Debug
    )

    A decoded QUIC frame. Padding collapses a run of zero bytes to its length; Stream carries application data on a stream, with a byte offset and a fin flag marking the end of the stream (RFC 9000 §19.8).

    Frame::acked

    fn Frame::acked(self : Frame) -> Array[(UInt64, UInt64)] raise Refused

    The packet numbers an ACK or ACK_ECN frame acknowledges, as ascending inclusive ranges; empty for every other frame.

    Frame::equal

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

    Frame::not_equal

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

    Frame::to_repr

    Seen

    pub struct Seen {
    runs : Array[(UInt64, UInt64)]
    }

    The packet numbers seen, held as ascending, non-overlapping, non-adjacent inclusive runs [lo, hi].

    Seen::add

    fn Seen::add(self : Seen, pn : UInt64) -> Unit

    Record that packet number pn arrived. Out-of-order and duplicate numbers are absorbed: the runs stay ascending and disjoint however they come in.

    Seen::contains

    fn Seen::contains(self : Seen, pn : UInt64) -> Bool

    Whether packet number pn has been received.

    Seen::fields

    fn Seen::fields(self : Seen) -> (UInt64, UInt64, Array[(UInt64, UInt64)])?

    The ACK frame fields for the current set: the Largest Acknowledged, the First ACK Range (how many contiguous packets below the largest are acked), and the descending (Gap, ACK Range Length) list. None when nothing has been received.

    Seen::is_empty

    fn Seen::is_empty(self : Seen) -> Bool

    Whether nothing has been received.

    Seen::largest

    fn Seen::largest(self : Seen) -> UInt64?

    The largest packet number received, or None when empty.

    Seen::new

    fn Seen::new() -> Seen

    An empty set: nothing received yet.

    Seen::ranges

    fn Seen::ranges(self : Seen) -> Array[(UInt64, UInt64)]

    The packet numbers as ascending inclusive ranges.

    Seen::read

    fn Seen::read(largest : UInt64, first_range : UInt64, pairs : Array[(UInt64, UInt64)]) -> Seen raise Refused

    The set an ACK frame's fields describe, the inverse of fields.

    decode

    fn decode(b : BytesView) -> (Frame, Int)?

    Read one frame at the start of b, returning it and the bytes it occupied, or None on a truncated frame or a type this brick does not yet decode. A PADDING frame absorbs the whole run of leading zero bytes.

    elicits_ack

    fn elicits_ack(frame : Frame) -> Bool

    Whether a single frame is ack-eliciting (RFC 9000 §13.2.1): every frame except PADDING, ACK, ACK_ECN, and CONNECTION_CLOSE obliges the peer to acknowledge the packet.

    encode

    fn encode(f : Frame) -> Bytes

    Encode a frame to its wire bytes.

    Source Files