Field #0 (Tag = 0x19, WireSubMsg = 12) self-describing schema metadata.
Encodes optional type_name, fields (map<uint32, string>), and recursive
children (map<uint32, SchemaMeta>).
Summary
Functions
Returns the child SchemaMeta for field_num, or nil.
Decodes the inner field stream of a SchemaMeta message.
Decodes a Field #0 SchemaMeta starting right after the 0x19 tag (i.e. at ByteLen).
Enforces container depth (+1 for the Field #0 WireSubMsg, +2 per children hop).
Encodes the inner field stream of a SchemaMeta message (without outer tag or ByteLen).
Encodes a SchemaMeta struct as a complete Field #0 [0x19][ByteLen][body] iodata fragment.
Merges two SchemaMeta tables according to Spec Section 8.2
Resolves a field name from meta, falling back to "field_<N>" when absent or empty "".
Types
@type t() :: %OmniBuf.SchemaMeta{ children: %{optional(non_neg_integer()) => t()}, fields: %{optional(non_neg_integer()) => String.t()}, type_name: String.t() }
Functions
@spec child_meta(t() | nil, non_neg_integer()) :: t() | nil
Returns the child SchemaMeta for field_num, or nil.
@spec decode_body(binary(), non_neg_integer(), t()) :: {:ok, t()} | {:error, OmniBuf.Error.t()}
Decodes the inner field stream of a SchemaMeta message.
@spec decode_field(binary(), non_neg_integer()) :: {:ok, t(), binary()} | {:error, OmniBuf.Error.t()}
Decodes a Field #0 SchemaMeta starting right after the 0x19 tag (i.e. at ByteLen).
Enforces container depth (+1 for the Field #0 WireSubMsg, +2 per children hop).
Encodes the inner field stream of a SchemaMeta message (without outer tag or ByteLen).
Encodes a SchemaMeta struct as a complete Field #0 [0x19][ByteLen][body] iodata fragment.
Merges two SchemaMeta tables according to Spec Section 8.2:
- Later non-empty
type_namewins. - Later
fieldsentries override per field number (an empty string""clears an inherited name). childrenmaps merge recursively by field number.
@spec resolve_field_name(t() | nil, non_neg_integer()) :: String.t()
Resolves a field name from meta, falling back to "field_<N>" when absent or empty "".