mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
17 lines
227 B
Rust
17 lines
227 B
Rust
#[derive(Default)]
|
|
#[mlua::userdata]
|
|
struct Foo {
|
|
x: u32,
|
|
}
|
|
|
|
#[mlua::userdata_impl]
|
|
impl Foo {
|
|
#[lua(setter)]
|
|
fn set_x(self, val: u32) -> mlua::Result<()> {
|
|
let _ = val;
|
|
Ok(())
|
|
}
|
|
}
|
|
|
|
fn main() {}
|