pub trait LuaRead<L>: Sized {
fn lua_read_at_position(lua: L, index: NonZeroI32) -> Result<Self, L>;
fn n_values_expected() -> i32 { ... }
fn lua_read(lua: L) -> Result<Self, L> { ... }
fn lua_read_at_maybe_zero_position(lua: L, index: i32) -> 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: NonZeroI32) -> Result<Self, L>
fn lua_read_at_position(lua: L, index: NonZeroI32) -> Result<Self, L>
Reads the data from Lua at a given position.
Provided Methods§
fn n_values_expected() -> i32
fn lua_read_at_maybe_zero_position(lua: L, index: i32) -> Result<Self, L>
Implementations on Foreign Types§
source§impl<L, T> LuaRead<L> for Vec<T>where
L: AsLua,
T: for<'a> LuaRead<PushGuard<&'a LuaTable<L>>> + 'static,
impl<L, T> LuaRead<L> for Vec<T>where
L: AsLua,
T: for<'a> LuaRead<PushGuard<&'a LuaTable<L>>> + 'static,
fn lua_read_at_position(lua: L, index: NonZeroI32) -> Result<Self, L>
source§impl<L, T, const N: usize> LuaRead<L> for [T; N]where
L: AsLua,
T: for<'a> LuaRead<PushGuard<&'a LuaTable<L>>> + 'static,
impl<L, T, const N: usize> LuaRead<L> for [T; N]where
L: AsLua,
T: for<'a> LuaRead<PushGuard<&'a LuaTable<L>>> + 'static,
fn lua_read_at_position(lua: L, index: NonZeroI32) -> Result<Self, L>
source§impl<L, K, V> LuaRead<L> for HashMap<K, V>where
L: AsLua,
K: 'static + Hash + Eq + for<'k> LuaRead<&'k LuaTable<L>>,
V: 'static + for<'v> LuaRead<PushGuard<&'v LuaTable<L>>>,
impl<L, K, V> LuaRead<L> for HashMap<K, V>where
L: AsLua,
K: 'static + Hash + Eq + for<'k> LuaRead<&'k LuaTable<L>>,
V: 'static + for<'v> LuaRead<PushGuard<&'v LuaTable<L>>>,
HashMap