mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
15 lines
201 B
Rust
15 lines
201 B
Rust
#[derive(Default, mlua::UserData)]
|
|
struct Foo {
|
|
x: u32,
|
|
}
|
|
|
|
#[mlua::userdata_impl]
|
|
impl Foo {
|
|
#[lua(field)]
|
|
fn as_name(name: &str) -> String {
|
|
name.to_string()
|
|
}
|
|
}
|
|
|
|
fn main() {}
|