API Reference PB v#0.2.0

Copy Markdown View Source

Modules

PB

Data-driven protobuf toolkit for Elixir. Runtime usage needs no code generation or build step. A schema is a plain Elixir data structure produced by compile/1.

Message-level app/proto conversion spec.

An adapter to_proto/from_proto callback returned {:error, reason}, returned a non-tagged value, or raised. :fqn names the message, :direction is :to_proto or :from_proto, and :reason carries the callback's reason. See PB.Error.

Structurally invalid serialized input: protobuf wire bytes that are truncated or malformed, or JSON or text format input that is not well-formed for the target. The :format field discriminates :wire, :json and :text.

Shared toolkit and umbrella type for PB's structured errors.

ProtoJSON encoder/decoder for PB.

Option failure: the caller passed options the API does not accept, a known option carried an invalid value, or options were not a keyword list. See PB.Error for the error model.

Embeds a compiled PB schema into a module at compile time.

Public introspection structs returned by PB.Schema.fetch_message/2 and friends.

Public projection of a compiled protobuf enum.

Public projection of a single enum value.

Public projection of a single extension range declaration.

Public projection of a compiled protobuf field or extension.

Public projection of a compiled protobuf message.

Public projection of a single service method.

Public projection of a compiled oneof declaration.

Public projection of a compiled protobuf service.

Behaviour for libraries that compile their own data into a PB schema, such as the protovalidate rules of pb_validate.

Compiled projection metadata attached to a message in the schema.

Schema-resolution and introspection failure.

Protobuf text format for PB.

Preserved protobuf wire field that is not represented by the compiled schema.

Input value or shape failure: a caller-supplied term does not fit the field's declared type, presence, or message structure.

Native adapters for protobuf well-known types.