OmniBuf v0.1 binary wire format for Elixir.
Supports all four OmniBuf implementation tiers:
- Tier 1 (Plugin):
protoc-gen-omnibuf-elixirgenerated structs, iodata codecs, and lazyOpaquezero-decode views with in-place iodata wire splicing. - Tier 2 (Protobuf):
OmniBuf.Protobufdirect serialization/deserialization of standardelixir-protobuf(use Protobuf) message structs. - Tier 3 (Declarative Schema):
use OmniBuf.Schemacompile-time struct DSL. - Tier 4 (Blind):
OmniBuf.Blind.decode/1andOmniBuf.Blind.decode_json/1for schema-less inspection with Field #0SchemaMetaname resolution.
Summary
Functions
Decodes an OmniBuf binary into a fresh struct of mod (replace mode).
Decodes an OmniBuf binary without a schema (Tier 4).
Decodes an OmniBuf binary without a schema and serializes to JSON (Tier 4).
Decodes OmniBuf wire bytes into a standard elixir-protobuf struct (Tier 2).
Encodes an OmniBuf.Schema or generated Tier 1 struct to an OmniBuf binary.
Encodes an OmniBuf.Schema or generated Tier 1 struct to iodata.
Encodes a standard elixir-protobuf struct into OmniBuf wire bytes (Tier 2).
Merges an OmniBuf binary onto an existing struct (merge mode).
Functions
@spec decode(binary(), module()) :: {:ok, struct()} | {:error, OmniBuf.Error.t()}
Decodes an OmniBuf binary into a fresh struct of mod (replace mode).
@spec decode_blind(binary(), keyword()) :: {:ok, map()} | {:error, OmniBuf.Error.t()}
Decodes an OmniBuf binary without a schema (Tier 4).
@spec decode_blind_json(binary(), keyword()) :: {:ok, String.t()} | {:error, OmniBuf.Error.t()}
Decodes an OmniBuf binary without a schema and serializes to JSON (Tier 4).
@spec decode_proto(binary(), module()) :: {:ok, struct()} | {:error, OmniBuf.Error.t()}
Decodes OmniBuf wire bytes into a standard elixir-protobuf struct (Tier 2).
Encodes an OmniBuf.Schema or generated Tier 1 struct to an OmniBuf binary.
Encodes an OmniBuf.Schema or generated Tier 1 struct to iodata.
Encodes a standard elixir-protobuf struct into OmniBuf wire bytes (Tier 2).
@spec merge(struct(), binary()) :: {:ok, struct()} | {:error, OmniBuf.Error.t()}
Merges an OmniBuf binary onto an existing struct (merge mode).