Skip to main content

lua_userdata_methods

Attribute Macro lua_userdata_methods 

Source
#[lua_userdata_methods]
Expand description

Walks the methods of an impl T { ... } block and, for each one tagged with a helper attribute (#[lua_method("name")] etc.), emits the corresponding UserdataMethods builder call inside a hidden __luna_userdata_register associated fn.

The UserdataMethods trait lives in ::luna_core::vm::UserdataMethods — the emitted code references it by absolute path so the derive works for pure luna-core embedders too. The intra-doc-link form is omitted because this proc-macro crate cannot see luna_core in its cargo doc scope.

The original impl block is re-emitted unchanged (minus the helper attributes themselves), so the named fns are still directly callable from Rust.