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_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_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_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, raising on overrun.

    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::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_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

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io