Sign in

    yugonlian/moon-avro/codec does not have a README file

    CodecError

    pub(all) suberror CodecError {
    TypeMismatch(expected~ : String, actual~ : String)
    UnexpectedEof(offset~ : Int)
    InvalidEncoding(offset~ : Int, message~ : String)
    InvalidLength(offset~ : Int, length~ : Int64)
    LimitExceeded(offset~ : Int, limit~ : String)
    MissingField(field~ : String)
    TrailingData(offset~ : Int)
    } derive(Eq,
    Debug
    )

    Binary datum codec failures.

    CodecLimits

    pub struct CodecLimits {
    max_depth : Int
    max_collection_items : Int
    max_bytes : Int
    } derive(Eq,
    Debug
    )

    Resource limits applied while decoding or constructing Avro binary data.

    Limits are deliberately part of the public API: callers reading untrusted streams should choose bounds appropriate for their protocol.

    CodecLimits::max_bytes

    fn CodecLimits::max_bytes(self : CodecLimits) -> Int

    CodecLimits::max_collection_items

    fn CodecLimits::max_collection_items(self : CodecLimits) -> Int

    CodecLimits::max_depth

    fn CodecLimits::max_depth(self : CodecLimits) -> Int

    CodecLimits::new

    fn CodecLimits::new(max_depth? : Int, max_collection_items? : Int, max_bytes? : Int) -> CodecLimits

    Datum

    pub(all) enum Datum {
    Null
    Boolean(Bool)
    Int(Int)
    Long(Int64)
    Float(Float)
    Double(Double)
    Bytes(Bytes)
    String(String)
    Array(Array[Datum])
    Map(Map[String, Datum])
    Record(Array[(String, Datum)])
    Enum(Int, String)
    Union(Int, Datum)
    Fixed(Bytes)
    } derive(Eq,
    Debug
    )

    Runtime values accepted by the generic Avro datum codec.

    Decoder

    pub struct Decoder {
    input : Bytes
    offset : Int
    limits : CodecLimits
    } derive(
    Debug
    )

    A bounded cursor over an Avro binary byte sequence.

    Decoder::ensure_finished

    fn Decoder::ensure_finished(self : Decoder) -> Unit raise CodecError

    Decoder::limits

    fn Decoder::limits(self : Decoder) -> CodecLimits

    Decoder::new

    fn Decoder::new(input : Bytes, limits? : CodecLimits) -> Decoder raise CodecError

    Decoder::offset

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

    Decoder::read_byte

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

    Decoder::read_bytes

    fn Decoder::read_bytes(self : Decoder) -> Bytes raise CodecError

    Decoder::read_double

    fn Decoder::read_double(self : Decoder) -> Double raise CodecError

    Decoder::read_float

    fn Decoder::read_float(self : Decoder) -> Float raise CodecError

    Decoder::read_int

    fn Decoder::read_int(self : Decoder) -> Int raise CodecError

    Decoder::read_long

    fn Decoder::read_long(self : Decoder) -> Int64 raise CodecError

    Decoder::read_raw

    fn Decoder::read_raw(self : Decoder, length : Int) -> Bytes raise CodecError

    Decoder::read_string

    fn Decoder::read_string(self : Decoder) -> String raise CodecError

    Decoder::remaining

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

    Encoder

    A growable Avro-binary writer. It uses Avro's little-endian float layout and zigzag LEB128 integer representation.

    Encoder::length

    fn Encoder::length(self : Encoder) -> Int

    Encoder::new

    fn Encoder::new(limits? : CodecLimits) -> Encoder

    Encoder::to_bytes

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

    Encoder::write_byte

    fn Encoder::write_byte(self : Encoder, byte : Byte) -> Unit raise CodecError

    Encoder::write_bytes

    fn Encoder::write_bytes(self : Encoder, value : BytesView) -> Unit raise CodecError

    Encoder::write_double

    fn Encoder::write_double(self : Encoder, value : Double) -> Unit raise CodecError

    Encoder::write_float

    fn Encoder::write_float(self : Encoder, value : Float) -> Unit raise CodecError

    Encoder::write_int

    fn Encoder::write_int(self : Encoder, value : Int) -> Unit raise CodecError

    Encoder::write_long

    fn Encoder::write_long(self : Encoder, value : Int64) -> Unit raise CodecError

    Encoder::write_raw

    fn Encoder::write_raw(self : Encoder, bytes : BytesView) -> Unit raise CodecError

    Encoder::write_string

    fn Encoder::write_string(self : Encoder, value : StringView) -> Unit raise CodecError

    decode

    fn decode(schema :
    Schema
    , input : Bytes, limits? : CodecLimits) -> Datum raise CodecError

    Decode one datum according to an Avro schema and reject trailing bytes.

    decode_from

    fn decode_from(schema :
    Schema
    , decoder : Decoder) -> Datum raise CodecError

    Decode one datum from a caller-owned stream decoder, leaving later bytes available for the next datum.

    encode

    fn encode(schema :
    Schema
    , datum : Datum) -> Bytes raise CodecError

    Encode one datum according to an Avro schema.

    encode_into

    fn encode_into(schema :
    Schema
    , datum : Datum, encoder : Encoder) -> Unit raise CodecError

    Encode one datum into a caller-owned stream encoder.

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io