KiwiCodec.RustlerGenerator.DecoderMacro (kiwi_codec v0.3.0)

Copy Markdown View Source

Rusty-Elixir macro support for generated Rustler decoders.

Entrypoint wrappers are authored with defnif. Full schema decoders use the same semantic boundary, but intentionally lower to compact Rust macro invocations instead of expanded Rust function bodies. This keeps generator authoring in Elixir/RustQ while preserving small generated source.

Summary

Functions

entrypoint(nif_name, decoder_name)

(macro)

enum_decoder(definition)

@spec enum_decoder(KiwiCodec.Schema.Enum.t()) :: RustQ.Rust.Fragment.t()

message_decoder(definition, module_prefix, definition_map, field_expr_fun)

@spec message_decoder(KiwiCodec.Schema.Message.t(), String.t(), map(), (term(),
                                                                  map() ->
                                                                    iodata())) ::
  RustQ.Rust.Fragment.t()

struct_decoder(definition, module_prefix, definition_map, field_expr_fun)

@spec struct_decoder(KiwiCodec.Schema.Struct.t(), String.t(), map(), (term(), map() ->
                                                                  iodata())) ::
  RustQ.Rust.Fragment.t()