KiwiCodec.Wire (kiwi_codec v0.2.0)

Copy Markdown View Source

Kiwi primitive wire encoders and decoders.

Functions return {value, rest} when decoding so higher-level decoders can compose primitive, struct, message, and repeated-field decoding.

Summary

Types

primitive_type()

@type primitive_type() ::
  :bool | :byte | :float | :int | :int64 | :string | :uint | :uint64

Functions

decode(type, binary)

@spec decode(primitive_type(), binary()) :: {term(), binary()}

decode_byte_array(binary)

@spec decode_byte_array(binary()) :: {binary(), binary()}

encode(type, value)

@spec encode(primitive_type(), term()) :: iodata()

encode_byte_array(value)

@spec encode_byte_array(binary()) :: iodata()