View Source Protox.Encode (Protox v1.7.3)

This module contains the functions necessary to encode protobuf messages.

Summary

Functions

encode(msg) deprecated

Encode a protobuf message into IO data.

encode!(msg) deprecated

Throwing version of encode/1.

Functions

This function is deprecated. Use Protox.encode/1 instead.
@spec 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.
@spec encode!(struct()) :: iodata() | no_return()

Throwing version of encode/1.