pub trait LuaRead: Sized {
// Required method
fn lua_read_with_pop(
lua: *mut lua_State,
index: i32,
pop: i32,
) -> Option<Self>;
// Provided methods
fn lua_read(lua: *mut lua_State) -> Option<Self> { ... }
fn lua_read_at_position(lua: *mut lua_State, index: i32) -> Option<Self> { ... }
}
Expand description
Types that can be obtained from a Lua context.
Most types that implement LuaPush
also implement LuaRead
, but this is not always the case
(for example &'static str
implements LuaPush
but not LuaRead
).
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.