daqing/moonkafka/buf does not have a README file

    DecodeError

    pub(all) suberror DecodeError {
    UnexpectedEof
    Malformed(String)
    }

    Decoder

    pub struct Decoder {
    data : Bytes
    pos : Int
    }

    Decoder::new

    fn Decoder::new(data : Bytes, start? : Int) -> Decoder

    Decoder::read_bool

    fn Decoder::read_bool(self : Decoder) -> Bool raise DecodeError

    Decoder::read_byte

    fn Decoder::read_byte(self : Decoder) -> Byte raise DecodeError

    Decoder::read_bytes

    fn Decoder::read_bytes(self : Decoder, n : Int) -> Bytes raise DecodeError

    Decoder::read_bytes_view

    fn Decoder::read_bytes_view(self : Decoder, n : Int) -> BytesView raise DecodeError

    Zero-copy view over the next n bytes of the backing buffer — no copy is made, so callers that only inspect or immediately re-read the bytes (e.g. blobbing a whole compressed records region before building the owned Bytes a decompressor needs) avoid a defensive copy. The returned BytesView borrows self.data and stays valid while that Bytes outlives the decoder.

    Decoder::read_compact_len

    fn Decoder::read_compact_len(self : Decoder) -> Int raise DecodeError

    Compact length prefix (value + 1); returns -1 for the null marker.

    Decoder::read_compact_nullable_string

    fn Decoder::read_compact_nullable_string(self : Decoder) -> String? raise DecodeError

    Decoder::read_compact_string

    fn Decoder::read_compact_string(self : Decoder) -> String raise DecodeError

    Decoder::read_f64

    fn Decoder::read_f64(self : Decoder) -> Double raise DecodeError

    FLOAT64: big-endian IEEE 754 double.

    Decoder::read_i16

    fn Decoder::read_i16(self : Decoder) -> Int raise DecodeError

    Decoder::read_i32

    fn Decoder::read_i32(self : Decoder) -> Int raise DecodeError

    Decoder::read_i64

    fn Decoder::read_i64(self : Decoder) -> Int64 raise DecodeError

    Decoder::read_i8

    fn Decoder::read_i8(self : Decoder) -> Int raise DecodeError

    Decoder::read_nullable_string

    fn Decoder::read_nullable_string(self : Decoder) -> String? raise DecodeError

    Legacy NULLABLE_STRING: INT16 length, -1 = null.

    Decoder::read_uvarint

    fn Decoder::read_uvarint(self : Decoder) -> Int raise DecodeError

    Unsigned LEB128 varint.

    Decoder::read_varint

    fn Decoder::read_varint(self : Decoder) -> Int raise DecodeError

    Zig-zag varint.

    Decoder::read_varlong

    fn Decoder::read_varlong(self : Decoder) -> Int64 raise DecodeError

    Zig-zag varlong.

    Decoder::remaining

    fn Decoder::remaining(self : Decoder) -> Int

    Decoder::skip

    fn Decoder::skip(self : Decoder, n : Int) -> Unit raise DecodeError

    Skip n bytes. Negative n and overruns raise; bounds are computed by subtraction so a malformed huge length cannot overflow the check.

    Decoder::skip_tag_buffer

    fn Decoder::skip_tag_buffer(self : Decoder) -> Unit raise DecodeError

    Read and discard a tag buffer.

    Encoder

    pub struct Encoder {
    buf : Array[Byte]
    }

    Encoder::new

    fn Encoder::new() -> Encoder

    Encoder::to_bytes

    fn Encoder::to_bytes(self : Encoder) -> Bytes

    Encoder::with_capacity

    fn Encoder::with_capacity(n : Int) -> Encoder

    Preallocate the backing array to hold roughly n bytes up front, so the hot request/record-batch encoding paths avoid repeated array growth reallocations. Growth stalls when the estimate is exceeded. n < 0 inserts a default growable capacity (16 bytes).

    Encoder::write_bool

    fn Encoder::write_bool(self : Encoder, v : Bool) -> Unit

    Encoder::write_byte

    fn Encoder::write_byte(self : Encoder, b : Byte) -> Unit

    Encoder::write_bytes

    fn Encoder::write_bytes(self : Encoder, b : Bytes) -> Unit

    Encoder::write_compact_len

    fn Encoder::write_compact_len(self : Encoder, n : Int) -> Unit

    Compact array/bytes length: count + 1 as unsigned varint.

    Encoder::write_compact_nullable_string

    fn Encoder::write_compact_nullable_string(self : Encoder, s : String?) -> Unit

    Encoder::write_compact_string

    fn Encoder::write_compact_string(self : Encoder, s : String) -> Unit

    Encoder::write_f64

    fn Encoder::write_f64(self : Encoder, v : Double) -> Unit

    FLOAT64: big-endian IEEE 754 double (quota config values).

    Encoder::write_i16

    fn Encoder::write_i16(self : Encoder, v : Int) -> Unit

    Encoder::write_i32

    fn Encoder::write_i32(self : Encoder, v : Int) -> Unit

    Encoder::write_i64

    fn Encoder::write_i64(self : Encoder, v : Int64) -> Unit

    Encoder::write_i8

    fn Encoder::write_i8(self : Encoder, v : Int) -> Unit

    Encoder::write_nullable_string

    fn Encoder::write_nullable_string(self : Encoder, s : String?) -> Unit

    Legacy NULLABLE_STRING: INT16 length, -1 = null.

    Encoder::write_tag_buffer

    fn Encoder::write_tag_buffer(self : Encoder) -> Unit

    Empty tag buffer.

    Encoder::write_tagged_fields

    fn Encoder::write_tagged_fields(self : Encoder, tags : Array[(Int, Bytes)]) -> Unit

    Tag buffer with the given tagged fields. Count, tag numbers, and payload sizes are plain unsigned varints (not compact +1). Fields are written in ascending tag order as the protocol requires; tag numbers must be unique.

    Encoder::write_uvarint

    fn Encoder::write_uvarint(self : Encoder, v : UInt) -> Unit

    Unsigned LEB128 varint.

    Encoder::write_varint

    fn Encoder::write_varint(self : Encoder, v : Int) -> Unit

    Zig-zag varint (used inside record batches).

    Encoder::write_varlong

    fn Encoder::write_varlong(self : Encoder, v : Int64) -> Unit

    Zig-zag varlong (used inside record batches).

    Source Files