Deterministic length-prefixed binary framing for MoonBit
MW magic | version | kind | 3 字节大端 payload 长度 | checksum | payloadlet frame = @moonwire.Frame::new(1, 7, b"hello").unwrap()
let wire = @moonwire.encode(frame)
let same = @moonwire.decode(wire).unwrap()moon fmt --check
moon check --target wasm-gc --deny-warn
moon check --target wasm --deny-warn
moon check --target js --deny-warn
moon check --target native --deny-warn
moon test --target wasm-gcpub struct Frame {
version : Int
kind : Int
payload : Bytes
}Install
Download zipDeterministic length-prefixed binary framing for MoonBit