KiwiCodec.RustlerGenerator.Name (kiwi_codec v0.6.0)

Copy Markdown View Source

Naming helpers for Rustler decoder code generated from Kiwi schemas.

Summary

Functions

Returns the snake_case Rust identifier for a schema name. Schema names are identifiers, and a name that is not, as a schema decoded from binary may hold, fails where it is rendered.

Functions

decoder_function(name)

@spec decoder_function(String.t()) :: atom()

field_name(name)

@spec field_name(String.t()) :: String.t()

message_fields_function(name)

@spec message_fields_function(String.t()) :: atom()

module_atom_static(name)

@spec module_atom_static(String.t()) :: atom()

module_name(module_prefix, name)

@spec module_name(String.t(), String.t()) :: String.t()

rust_identifier(name)

@spec rust_identifier(String.t()) :: String.t()

Returns the snake_case Rust identifier for a schema name. Schema names are identifiers, and a name that is not, as a schema decoded from binary may hold, fails where it is rendered.

static_alias(name)

@spec static_alias(atom()) :: Macro.t()

struct_keys_static(name)

@spec struct_keys_static(String.t()) :: atom()