Documentation
¶
Overview ¶
This file is a byte-identical copy of pkg/wasm/wasm-runtime/runtime/codec.go used by codec_parity_test.go to validate that the server-side stub in pkg/wasm/stubs.go and the WASM-side runtime stay in sync. Any change to runtime/codec.go MUST be mirrored here AND in stubs.go.
Index ¶
- func HexDecode(s string) []byte
- func HexEncode(src []byte) string
- type Decoder
- func (d *Decoder) Bool() bool
- func (d *Decoder) Bytes() []byte
- func (d *Decoder) F32() float32
- func (d *Decoder) F64() float64
- func (d *Decoder) I32() int32
- func (d *Decoder) I64() int64
- func (d *Decoder) String() string
- func (d *Decoder) U8() uint8
- func (d *Decoder) U16() uint16
- func (d *Decoder) U32() uint32
- func (d *Decoder) U64() uint64
- type Encoder
- func (e *Encoder) Bool(v bool)
- func (e *Encoder) Bytes(v []byte)
- func (e *Encoder) F32(v float32)
- func (e *Encoder) F64(v float64)
- func (e *Encoder) I32(v int32)
- func (e *Encoder) I64(v int64)
- func (e *Encoder) String(v string)
- func (e *Encoder) U8(v uint8)
- func (e *Encoder) U16(v uint16)
- func (e *Encoder) U32(v uint32)
- func (e *Encoder) U64(v uint64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Decoder ¶
Decoder reads a little-endian binary stream. Err accumulates the first decode error — check it once at the end rather than per call.
type Encoder ¶
type Encoder struct{ Buf []byte }
Encoder writes a little-endian binary stream into Buf. Preallocate with NewEncoder to avoid repeated append growth.
func NewEncoder ¶
Click to show internal directories.
Click to hide internal directories.