Interpreter for parsed Kiwi schemas without generated modules.
Prefer generated modules for application code. This interpreter is useful for
tooling, inspection, and compatibility tests where schemas are loaded at runtime.
For repeated calls, prepare the parsed schema once with prepare/1 to replace
linear definition, message-field, and enum lookups with indexed lookups.
Summary
Functions
Builds reusable lookup indexes for repeated runtime interpretation.
Skips the value of message field field_id of definition_name at the start
of binary, returning the bytes after it.
Types
@type schema() :: KiwiCodec.Schema.t() | KiwiCodec.SchemaInterpreter.Prepared.t()
Functions
@spec prepare(KiwiCodec.Schema.t()) :: KiwiCodec.SchemaInterpreter.Prepared.t()
Builds reusable lookup indexes for repeated runtime interpretation.
@spec skip_message_field(schema(), String.t(), non_neg_integer(), binary()) :: binary()
Skips the value of message field field_id of definition_name at the start
of binary, returning the bytes after it.
Used to step over fields a compiled decoder does not know, with the schema the data was written with.