mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
13 lines
194 B
Rust
13 lines
194 B
Rust
#[derive(Default)]
|
|
#[mlua::userdata]
|
|
struct Foo(Vec<u8>);
|
|
|
|
#[mlua::userdata_impl]
|
|
impl Foo {
|
|
fn first(&self, data: &mut [u8]) -> mlua::Result<u8> {
|
|
Ok(data[0])
|
|
}
|
|
}
|
|
|
|
fn main() {}
|