RustQ.Rustler.Atom (rustq v0.8.3)

Copy Markdown View Source

Generates Rustler atom declarations, decoders, dispatchers, and cached atom helpers.

Decoder and dispatch helpers prefer RustQ AST. Options such as :on, :cases, and :unknown may accept explicit Rust expression strings for advanced caller escape hatches; prefer AST expressions when composing generated code.

Summary

Functions

cached(atoms, opts \\ [])

@spec cached(
  [atom() | String.t() | {atom() | String.t(), String.t()}],
  keyword()
) :: [RustQ.Rust.Fragment.t()]

cached_atom(arg1, arg2, arg3)

@spec cached_atom(
  RustQ.Type.path(:Env),
  RustQ.Type.ref(RustQ.Type.raw(:"OnceLock<Atom>")),
  RustQ.Type.ref(RustQ.Type.path(:str))
) :: atom()

declaration(atoms, opts \\ [])

@spec declaration(
  [atom() | String.t() | {atom() | String.t(), String.t()}],
  keyword()
) :: RustQ.Rust.Fragment.t()

decoder(name, opts)

@spec decoder(
  atom() | String.t(),
  keyword()
) :: RustQ.Rust.Fragment.t()

dispatch(name, opts)

@spec dispatch(
  atom() | String.t(),
  keyword()
) :: RustQ.Rust.Fragment.t()