Trait LuaRead

Source
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§

Source

fn lua_read_at_position(lua: L, index: i32) -> Result<Self, L>

Reads the data from Lua at a given position.

Provided Methods§

Source

fn lua_read(lua: L) -> Result<Self, L>

Reads the data from Lua.

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.

Implementations on Foreign Types§

Source§

impl<'lua, L> LuaRead<L> for bool
where L: AsLua<'lua>,

Source§

fn lua_read_at_position(lua: L, index: i32) -> Result<bool, L>

Source§

impl<'lua, L> LuaRead<L> for f32
where L: AsLua<'lua>,

Source§

fn lua_read_at_position(lua: L, index: i32) -> Result<f32, L>

Source§

impl<'lua, L> LuaRead<L> for f64
where L: AsLua<'lua>,

Source§

fn lua_read_at_position(lua: L, index: i32) -> Result<f64, L>

Source§

impl<'lua, L> LuaRead<L> for i8
where L: AsLua<'lua>,

Source§

fn lua_read_at_position(lua: L, index: i32) -> Result<i8, L>

Source§

impl<'lua, L> LuaRead<L> for i16
where L: AsLua<'lua>,

Source§

fn lua_read_at_position(lua: L, index: i32) -> Result<i16, L>

Source§

impl<'lua, L> LuaRead<L> for i32
where L: AsLua<'lua>,

Source§

fn lua_read_at_position(lua: L, index: i32) -> Result<i32, L>

Source§

impl<'lua, L> LuaRead<L> for u8
where L: AsLua<'lua>,

Source§

fn lua_read_at_position(lua: L, index: i32) -> Result<u8, L>

Source§

impl<'lua, L> LuaRead<L> for u16
where L: AsLua<'lua>,

Source§

fn lua_read_at_position(lua: L, index: i32) -> Result<u16, L>

Source§

impl<'lua, L> LuaRead<L> for u32
where L: AsLua<'lua>,

Source§

fn lua_read_at_position(lua: L, index: i32) -> Result<u32, L>

Source§

impl<'lua, L> LuaRead<L> for ()
where L: AsLua<'lua>,

Source§

impl<'lua, L> LuaRead<L> for String
where L: AsLua<'lua>,

Source§

fn lua_read_at_position(lua: L, index: i32) -> Result<String, L>

Source§

impl<'lua, L> LuaRead<L> for Vec<AnyLuaValue>
where L: AsMutLua<'lua>,

Source§

fn lua_read_at_position(lua: L, index: i32) -> Result<Self, L>

Source§

impl<'lua, L> LuaRead<L> for HashMap<AnyHashableLuaValue, AnyLuaValue>
where L: AsMutLua<'lua>,

Source§

fn lua_read_at_position(lua: L, index: i32) -> Result<Self, L>

Source§

impl<'lua, LU, A: for<'a> LuaRead<&'a mut LU>, B: for<'a> LuaRead<&'a mut LU>, C: for<'a> LuaRead<&'a mut LU>, D: for<'a> LuaRead<&'a mut LU>, E: for<'a> LuaRead<&'a mut LU>, F: for<'a> LuaRead<&'a mut LU>, G: for<'a> LuaRead<&'a mut LU>, H: for<'a> LuaRead<&'a mut LU>, I: for<'a> LuaRead<&'a mut LU>, J: for<'a> LuaRead<&'a mut LU>, K: for<'a> LuaRead<&'a mut LU>, L: for<'a> LuaRead<&'a mut LU>, M: for<'a> LuaRead<&'a mut LU>> LuaRead<LU> for (A, B, C, D, E, F, G, H, I, J, K, L, M)
where LU: AsLua<'lua>,

Source§

impl<'lua, LU, B: for<'a> LuaRead<&'a mut LU>, C: for<'a> LuaRead<&'a mut LU>, D: for<'a> LuaRead<&'a mut LU>, E: for<'a> LuaRead<&'a mut LU>, F: for<'a> LuaRead<&'a mut LU>, G: for<'a> LuaRead<&'a mut LU>, H: for<'a> LuaRead<&'a mut LU>, I: for<'a> LuaRead<&'a mut LU>, J: for<'a> LuaRead<&'a mut LU>, K: for<'a> LuaRead<&'a mut LU>, L: for<'a> LuaRead<&'a mut LU>, M: for<'a> LuaRead<&'a mut LU>> LuaRead<LU> for (B, C, D, E, F, G, H, I, J, K, L, M)
where LU: AsLua<'lua>,

Source§

impl<'lua, LU, C: for<'a> LuaRead<&'a mut LU>, D: for<'a> LuaRead<&'a mut LU>, E: for<'a> LuaRead<&'a mut LU>, F: for<'a> LuaRead<&'a mut LU>, G: for<'a> LuaRead<&'a mut LU>, H: for<'a> LuaRead<&'a mut LU>, I: for<'a> LuaRead<&'a mut LU>, J: for<'a> LuaRead<&'a mut LU>, K: for<'a> LuaRead<&'a mut LU>, L: for<'a> LuaRead<&'a mut LU>, M: for<'a> LuaRead<&'a mut LU>> LuaRead<LU> for (C, D, E, F, G, H, I, J, K, L, M)
where LU: AsLua<'lua>,

Source§

impl<'lua, LU, D: for<'a> LuaRead<&'a mut LU>, E: for<'a> LuaRead<&'a mut LU>, F: for<'a> LuaRead<&'a mut LU>, G: for<'a> LuaRead<&'a mut LU>, H: for<'a> LuaRead<&'a mut LU>, I: for<'a> LuaRead<&'a mut LU>, J: for<'a> LuaRead<&'a mut LU>, K: for<'a> LuaRead<&'a mut LU>, L: for<'a> LuaRead<&'a mut LU>, M: for<'a> LuaRead<&'a mut LU>> LuaRead<LU> for (D, E, F, G, H, I, J, K, L, M)
where LU: AsLua<'lua>,

Source§

impl<'lua, LU, E: for<'a> LuaRead<&'a mut LU>, F: for<'a> LuaRead<&'a mut LU>, G: for<'a> LuaRead<&'a mut LU>, H: for<'a> LuaRead<&'a mut LU>, I: for<'a> LuaRead<&'a mut LU>, J: for<'a> LuaRead<&'a mut LU>, K: for<'a> LuaRead<&'a mut LU>, L: for<'a> LuaRead<&'a mut LU>, M: for<'a> LuaRead<&'a mut LU>> LuaRead<LU> for (E, F, G, H, I, J, K, L, M)
where LU: AsLua<'lua>,

Source§

impl<'lua, LU, F: for<'a> LuaRead<&'a mut LU>, G: for<'a> LuaRead<&'a mut LU>, H: for<'a> LuaRead<&'a mut LU>, I: for<'a> LuaRead<&'a mut LU>, J: for<'a> LuaRead<&'a mut LU>, K: for<'a> LuaRead<&'a mut LU>, L: for<'a> LuaRead<&'a mut LU>, M: for<'a> LuaRead<&'a mut LU>> LuaRead<LU> for (F, G, H, I, J, K, L, M)
where LU: AsLua<'lua>,

Source§

impl<'lua, LU, G: for<'a> LuaRead<&'a mut LU>, H: for<'a> LuaRead<&'a mut LU>, I: for<'a> LuaRead<&'a mut LU>, J: for<'a> LuaRead<&'a mut LU>, K: for<'a> LuaRead<&'a mut LU>, L: for<'a> LuaRead<&'a mut LU>, M: for<'a> LuaRead<&'a mut LU>> LuaRead<LU> for (G, H, I, J, K, L, M)
where LU: AsLua<'lua>,

Source§

impl<'lua, LU, H: for<'a> LuaRead<&'a mut LU>, I: for<'a> LuaRead<&'a mut LU>, J: for<'a> LuaRead<&'a mut LU>, K: for<'a> LuaRead<&'a mut LU>, L: for<'a> LuaRead<&'a mut LU>, M: for<'a> LuaRead<&'a mut LU>> LuaRead<LU> for (H, I, J, K, L, M)
where LU: AsLua<'lua>,

Source§

impl<'lua, LU, I: for<'a> LuaRead<&'a mut LU>, J: for<'a> LuaRead<&'a mut LU>, K: for<'a> LuaRead<&'a mut LU>, L: for<'a> LuaRead<&'a mut LU>, M: for<'a> LuaRead<&'a mut LU>> LuaRead<LU> for (I, J, K, L, M)
where LU: AsLua<'lua>,

Source§

impl<'lua, LU, J: for<'a> LuaRead<&'a mut LU>, K: for<'a> LuaRead<&'a mut LU>, L: for<'a> LuaRead<&'a mut LU>, M: for<'a> LuaRead<&'a mut LU>> LuaRead<LU> for (J, K, L, M)
where LU: AsLua<'lua>,

Source§

impl<'lua, LU, K: for<'a> LuaRead<&'a mut LU>, L: for<'a> LuaRead<&'a mut LU>, M: for<'a> LuaRead<&'a mut LU>> LuaRead<LU> for (K, L, M)
where LU: AsLua<'lua>,

Source§

fn lua_read_at_position(lua: LU, index: i32) -> Result<(K, L, M), LU>

Source§

impl<'lua, LU, L: for<'a> LuaRead<&'a mut LU>, M: for<'a> LuaRead<&'a mut LU>> LuaRead<LU> for (L, M)
where LU: AsLua<'lua>,

Source§

fn lua_read_at_position(lua: LU, index: i32) -> Result<(L, M), LU>

Source§

impl<'lua, LU, M> LuaRead<LU> for (M,)
where LU: AsMutLua<'lua>, M: LuaRead<LU>,

Source§

fn lua_read_at_position(lua: LU, index: i32) -> Result<(M,), LU>

Implementors§

Source§

impl<'lua, L> LuaRead<L> for AnyHashableLuaValue
where L: AsMutLua<'lua>,

Source§

impl<'lua, L> LuaRead<L> for AnyLuaValue
where L: AsMutLua<'lua>,

Source§

impl<'lua, L> LuaRead<L> for AnyLuaString
where L: AsLua<'lua>,

Source§

impl<'lua, L> LuaRead<L> for LuaFunction<L>
where L: AsMutLua<'lua>,

Source§

impl<'lua, L> LuaRead<L> for LuaTable<L>
where L: AsMutLua<'lua>,

Source§

impl<'lua, L> LuaRead<L> for StringInLua<L>
where L: AsLua<'lua>,

Source§

impl<'lua, T, L> LuaRead<L> for UserdataOnStack<T, L>
where L: AsMutLua<'lua>, T: 'lua + Any,