Skip to main content

LuaUserData

Derive Macro LuaUserData 

Source
#[derive(LuaUserData)]
{
    // Attributes available to this derive:
    #[lua]
    #[lua_impl]
}
Expand description

Derive UserDataTrait for a struct, exposing public fields to Lua.

§Supported field types (auto-converted to/from UdValue)

  • i8, i16, i32, i64, isizeUdValue::Integer
  • u8, u16, u32, u64, usizeUdValue::Integer
  • f32, f64UdValue::Number
  • boolUdValue::Boolean
  • StringUdValue::Str