Derive macros for the lua-rs embedding API.
#[derive(LuaUserData)]on a struct generates theUserDataimpl that exposes the struct's fields to Lua (obj.fieldreads/writes), with field attributes#[lua(skip)],#[lua(readonly)],#[lua(name = "...")].IntoLuacomes for free from the runtime's blanketimpl<T: UserData> IntoLua for T.- Struct attribute
#[lua_impl(Display, PartialEq, PartialOrd)]wires the matching metamethods (__tostring,__eq,__lt/__le) from the type's Rust trait impls. - Struct attribute
#[lua(methods)]makes the generatedUserDataalso register the methods declared by#[lua_methods]on animplblock. #[lua_methods]on animplblock exposes eachpub fn(&self/&mut self, ...)to Lua asobj:method(args).