Files
mlua-rs-mlua/tests/compile/userdata_static_with_self.rs
T

16 lines
201 B
Rust

#[derive(Default)]
#[mlua::userdata]
struct Foo {
x: u32,
}
#[mlua::userdata_impl]
impl Foo {
#[lua(field)]
fn get_x(&self) -> mlua::Result<u32> {
Ok(self.x)
}
}
fn main() {}