Lua.VM.Display.NativeFunc (Lua v1.0.0-rc.1)

View Source

Display wrapper for a native Elixir-backed Lua function ({:native_func, fun}) returned across the Lua.eval!/2 boundary.

Carries the underlying function so the Inspect impl can render the captured module/function/arity, falling back to the fun's default inspect output for anonymous functions.

Fields

  • :fun — the Elixir function passed to Lua.set!/3 or installed via deflua.
  • :ref — the original {:native_func, fun} tuple so callers can still pass it back to Lua.call_function/3.

The wrap fires in both decode: true and decode: false modes — raw {:native_func, fun} tuples have always leaked to the user. Internal pattern matches against {:native_func, _} are unaffected.

Summary

Types

t()

@type t() :: %Lua.VM.Display.NativeFunc{fun: function(), ref: tuple()}