KiwiCodec.RustlerGenerator.Field (kiwi_codec v0.7.0)

Copy Markdown View Source

How a generated decoder reads or skips a schema field: once, repeated for an array, or as a whole byte array for byte[].

Summary

Functions

Whether a field reads repeated, and the function reading one value of it as a term, with decoder naming a definition's decoder.

Whether a field skips repeated or as bytes, and the function skipping one value.

A field's row for a skip decoder: how to skip it.

A field's rows for a sparse decoder: id, key, and how to read it.

Functions

read(map, decoder)

@spec read(map(), (String.t() -> atom())) :: {boolean(), atom()}

Whether a field reads repeated, and the function reading one value of it as a term, with decoder naming a definition's decoder.

skip(map, definition_map)

@spec skip(map(), map()) :: {boolean(), boolean(), atom()}

Whether a field skips repeated or as bytes, and the function skipping one value.

skip_row(field, definition_map)

@spec skip_row(map(), map()) :: keyword()

A field's row for a skip decoder: how to skip it.

sparse_row(field)

@spec sparse_row(map()) :: keyword()

A field's rows for a sparse decoder: id, key, and how to read it.