1
1
Fork 0
mirror of https://github.com/lune-org/lune.git synced 2025-04-13 23:10:52 +01:00
lune/crates/lune-std-ffi/src/ffi/ffi_raw.rs
2024-10-13 05:09:31 +00:00

20 lines
695 B
Rust

use mlua::prelude::*;
// This is raw data coming from outside.
// Users must convert it to a Lua value, reference, or box to use it.
// The biggest reason for providing this is to allow the user to
// decide whether to move the data to a heap that Lua can manage (box),
// move it directly to Lua's data, or think of it as a pointer.
// This will help you distinguish between safe operations and
// relatively insecure operations, and help ensure that as little
// data copy as possible occurs, while allowing you to do little restrictions.
pub struct FfiRaw(*const ());
impl FfiRaw {
pub fn new(pointer: *const ()) -> Self {
Self(pointer)
}
}
impl LuaUserData for FfiRaw {}