pub trait LuaRead<L>: Sized {
// Required method
fn lua_read_at_position(lua: L, index: i32) -> Result<Self, L>;
// Provided method
fn lua_read(lua: L) -> Result<Self, L> { ... }
}
Expand description
Types that can be obtained from a Lua context.
Most types that implement Push
also implement LuaRead
, but this is not always the case
(for example &'static str
implements Push
but not LuaRead
).
Required Methods§
Sourcefn lua_read_at_position(lua: L, index: i32) -> Result<Self, L>
fn lua_read_at_position(lua: L, index: i32) -> Result<Self, L>
Reads the data from Lua at a given position.
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.