mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
15 lines
199 B
Rust
15 lines
199 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() {}
|