Protox.Encode (Protox v1.3.1) View Source

This module contains the functions necessary to encode protobuf messages.

Link to this section Summary

Functions

Encode a protobuf message into IO data.

Throwing version of encode/1.

Link to this section Functions

Specs

encode(struct()) :: {:ok, iodata()} | {:error, any()}

Encode a protobuf message into IO data.

Example

msg = %Fiz.Foo{a: 3, b: %{1 => %Fiz.Baz{}}}
{:ok, iodata} = Protox.Encode.encode(msg)

Specs

encode!(struct()) :: iodata() | no_return()

Throwing version of encode/1.