README

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

#
SingleObjectError

pub(all) suberror SingleObjectError {
InvalidMagic
TruncatedHeader(actual~ : Int, required~ : Int)
UnknownFingerprint(UInt64)
FingerprintMismatch(expected~ : UInt64, actual~ : UInt64)
Datum(
CodecError
)
} derive(Eq,
Debug
)

Failures produced by Avro Single-Object Encoding envelopes.

#
decode

Decode a Single-Object Encoding value with an expected schema. A mismatch is reported before the datum payload is interpreted.

#
decode_resolved

Resolve the writer schema by fingerprint and decode one Single-Object Encoding value. The resolver can use a registry, generated table or local map without coupling this package to a particular storage mechanism.

#
encode

Encode one datum using Avro Single-Object Encoding. The result contains the marker, the schema's CRC-64-AVRO fingerprint in little-endian order, and one ordinary Avro binary datum payload.

#
fingerprint

fn fingerprint(input : Bytes) -> UInt64 raise SingleObjectError

Validate the ten-byte envelope prefix and return its schema fingerprint.

#
magic

fn magic() -> Bytes

Return the two-byte Avro Single-Object Encoding marker (C3 01).

#
matches_schema

fn matches_schema(input : Bytes, schema :
Schema
) -> Bool

Return whether an encoded value carries the supplied schema fingerprint. Malformed and truncated envelopes return false rather than raising.

Source Files

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io