Protox.Encode (Protox v1.2.2) View Source

This module contains the functions necessary to encode protobuf messages and various types.

Protox users will want to use encode/1 and encode!/1 that take a protobuf message stored in a struct and that return an IO data that can be written to a file or a socket.

Link to this section Summary

Link to this section Functions

Specs

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

Specs

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

Specs

encode_bool(boolean()) :: binary()

Specs

encode_bytes(binary()) :: iodata()

Specs

encode_double(float() | atom()) :: binary()

Specs

encode_enum(integer()) :: iodata()

Specs

encode_fixed32(integer()) :: binary()

Specs

encode_fixed64(integer()) :: binary()

Specs

encode_float(float() | atom()) :: binary()

Specs

encode_int32(integer()) :: iodata()

Specs

encode_int64(integer()) :: iodata()

Specs

encode_message(struct()) :: iodata()

Specs

encode_sfixed32(integer()) :: binary()

Specs

encode_sfixed64(integer()) :: binary()

Specs

encode_sint32(integer()) :: iodata()

Specs

encode_sint64(integer()) :: iodata()

Specs

encode_string(String.t()) :: iodata()

Specs

encode_uint32(non_neg_integer()) :: iodata()

Specs

encode_uint64(non_neg_integer()) :: iodata()

Specs

encode_varint_32(integer()) :: iodata()

Specs

encode_varint_64(integer()) :: iodata()
Link to this function

encode_varint_signed(value)

View Source

Specs

encode_varint_signed(integer()) :: iodata()

Specs

Specs

make_key_bytes(Protox.Types.tag(), Protox.Types.type()) :: iodata()