KiwiCodec.RustlerGenerator.Full.Helpers (kiwi_codec v0.5.0)

Copy Markdown View Source

RustQ-authored full Kiwi decoder macro helpers.

Summary

Types

The Rust KiwiEnumVariant: an enum value and the atom name it decodes to.

The Rust KiwiFullDecodeFn: decodes one value of a type into a term.

The Rust KiwiFullField: a message field id, its index among the struct's values, and how to decode it.

Functions

The RustQ AST of each defrust definition.

Callable metadata for the module's definitions.

The Rust items the module generates, in order.

The module's defrustmacro definitions.

The macro_rules! items defrustmacro emits.

The Rust source the module generates.

The RustQ AST of each declared Rust type.

The Rust items the module's types generate.

The Rust types the module's @types declare.

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

Types

kiwi_enum_variant()

@type kiwi_enum_variant() :: %{
  value: RustQ.Type.u32(),
  name: RustQ.Type.raw(:"&'static str")
}

The Rust KiwiEnumVariant: an enum value and the atom name it decodes to.

kiwi_full_decode_fn()

@type kiwi_full_decode_fn() ::
  RustQ.Type.raw(
    :"for<'a> fn(Env<'a>, &mut Decoder<'_>) -> NifResult<Term<'a>>"
  )

The Rust KiwiFullDecodeFn: decodes one value of a type into a term.

kiwi_full_field()

@type kiwi_full_field() :: %{
  id: RustQ.Type.u32(),
  index: RustQ.Type.usize(),
  repeated: boolean(),
  decode: kiwi_full_decode_fn()
}

The Rust KiwiFullField: a message field id, its index among the struct's values, and how to decode it.

Functions

__rustq_asts__()

The RustQ AST of each defrust definition.

__rustq_callables__()

Callable metadata for the module's definitions.

__rustq_items__()

The Rust items the module generates, in order.

__rustq_macro_definitions__()

The module's defrustmacro definitions.

__rustq_macro_items__()

The macro_rules! items defrustmacro emits.

__rustq_source__()

The Rust source the module generates.

__rustq_type_asts__()

The RustQ AST of each declared Rust type.

__rustq_type_items__()

The Rust items the module's types generate.

__rustq_types__()

The Rust types the module's @types declare.

fragments(macros \\ [:kiwi_enum_decoder, :kiwi_struct_decoder, :kiwi_message_decoder])

@spec fragments([atom()]) :: [RustQ.Rust.Fragment.t()]

kiwi_enum_value(arg1, arg2, arg3)

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

kiwi_full_bool_value(arg1, arg2)

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

kiwi_full_byte_value(arg1, arg2)

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

kiwi_full_bytes_value(arg1, arg2)

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

kiwi_full_field_value(arg1, arg2, arg3)

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

kiwi_full_float_value(arg1, arg2)

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

kiwi_full_int64_value(arg1, arg2)

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

kiwi_full_int_value(arg1, arg2)

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

kiwi_full_string_value(arg1, arg2)

@spec kiwi_full_string_value(
  RustQ.Type.path(:Env, RustQ.Type.lifetime(:a)),
  RustQ.Type.mut_ref(RustQ.Type.path(:Decoder, RustQ.Type.lifetime(:_)))
) :: RustQ.Type.nif_result(term())

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

kiwi_full_uint64_value(arg1, arg2)

@spec kiwi_full_uint64_value(
  RustQ.Type.path(:Env, RustQ.Type.lifetime(:a)),
  RustQ.Type.mut_ref(RustQ.Type.path(:Decoder, RustQ.Type.lifetime(:_)))
) :: RustQ.Type.nif_result(term())

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

kiwi_full_uint_value(arg1, arg2)

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

kiwi_message_fields(arg1, arg2, arg3, arg4, arg5, arg6)

A Rust function defrust generates. It runs only as Rust; calling it from Elixir raises.

macro_call(name, args)

@spec macro_call(
  atom(),
  keyword()
) :: RustQ.Rust.Fragment.t()