Protox.Encode (Protox v1.6.3) View Source

This module contains the functions necessary to encode protobuf messages.

Link to this section Summary

Functions

encode(msg) deprecated

Encode a protobuf message into IO data.

encode!(msg) deprecated

Throwing version of encode/1.

Link to this section Functions

This function is deprecated. Use Protox.encode/1 instead.

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)
This function is deprecated. Use Protox.encode!/1 instead.

Specs

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

Throwing version of encode/1.