View Source Protox.Default (Protox v1.7.3)

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

@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)
""