Protox.Default (Protox v2.0.4)

View Source

Default values of Protocol Buffers types.

Note that generated structs contain a default/1 function to return the default value of a field using its name.

Summary

Functions

Returns the default value of a Protocol Buffer type specified with an atom.

Functions

default(arg1)

@spec default(atom() | {atom(), atom()}) ::
  false | integer() | float() | binary() | nil | atom()

Returns the default value of a Protocol Buffer type specified with an atom.

Examples

iex> Protox.Default.default(:bool)
false

iex> Protox.Default.default(:string)
""