pub trait LuaRead<L>: Sized {
// Required method
fn lua_read_at_position(lua: L, index: NonZeroI32) -> ReadResult<Self, L>;
// Provided methods
fn n_values_expected() -> i32 { ... }
fn lua_read(lua: L) -> ReadResult<Self, L> { ... }
fn lua_read_at_maybe_zero_position(
lua: L,
index: i32,
) -> ReadResult<Self, L>
where L: AsLua { ... }
}
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) -> ReadResult<Self, L>
fn lua_read_at_position(lua: L, index: NonZeroI32) -> ReadResult<Self, L>
Reads the data from Lua at a given position.
Provided Methods§
fn n_values_expected() -> i32
sourcefn lua_read(lua: L) -> ReadResult<Self, L>
fn lua_read(lua: L) -> ReadResult<Self, L>
Reads the data from Lua.
fn lua_read_at_maybe_zero_position(lua: L, index: i32) -> ReadResult<Self, L>where
L: AsLua,
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl<L> LuaRead<L> for boolwhere
L: AsLua,
impl<L> LuaRead<L> for boolwhere
L: AsLua,
fn lua_read_at_position(lua: L, index: NonZeroI32) -> ReadResult<Self, L>
source§impl<L> LuaRead<L> for f32where
L: AsLua,
impl<L> LuaRead<L> for f32where
L: AsLua,
fn lua_read_at_position(lua: L, index: NonZeroI32) -> ReadResult<f32, L>
source§impl<L> LuaRead<L> for f64where
L: AsLua,
impl<L> LuaRead<L> for f64where
L: AsLua,
fn lua_read_at_position(lua: L, index: NonZeroI32) -> ReadResult<f64, L>
source§impl<L> LuaRead<L> for i8where
L: AsLua,
impl<L> LuaRead<L> for i8where
L: AsLua,
fn lua_read_at_position(lua: L, index: NonZeroI32) -> ReadResult<i8, L>
source§impl<L> LuaRead<L> for i16where
L: AsLua,
impl<L> LuaRead<L> for i16where
L: AsLua,
fn lua_read_at_position(lua: L, index: NonZeroI32) -> ReadResult<i16, L>
source§impl<L> LuaRead<L> for i32where
L: AsLua,
impl<L> LuaRead<L> for i32where
L: AsLua,
fn lua_read_at_position(lua: L, index: NonZeroI32) -> ReadResult<i32, L>
source§impl<L> LuaRead<L> for i64where
L: AsLua,
impl<L> LuaRead<L> for i64where
L: AsLua,
fn lua_read_at_position(lua: L, index: NonZeroI32) -> ReadResult<i64, L>
source§impl<L> LuaRead<L> for isizewhere
L: AsLua,
impl<L> LuaRead<L> for isizewhere
L: AsLua,
fn lua_read_at_position(lua: L, index: NonZeroI32) -> ReadResult<isize, L>
source§impl<L> LuaRead<L> for u8where
L: AsLua,
impl<L> LuaRead<L> for u8where
L: AsLua,
fn lua_read_at_position(lua: L, index: NonZeroI32) -> ReadResult<u8, L>
source§impl<L> LuaRead<L> for u16where
L: AsLua,
impl<L> LuaRead<L> for u16where
L: AsLua,
fn lua_read_at_position(lua: L, index: NonZeroI32) -> ReadResult<u16, L>
source§impl<L> LuaRead<L> for u32where
L: AsLua,
impl<L> LuaRead<L> for u32where
L: AsLua,
fn lua_read_at_position(lua: L, index: NonZeroI32) -> ReadResult<u32, L>
source§impl<L> LuaRead<L> for u64where
L: AsLua,
impl<L> LuaRead<L> for u64where
L: AsLua,
fn lua_read_at_position(lua: L, index: NonZeroI32) -> ReadResult<u64, L>
source§impl<L> LuaRead<L> for ()where
L: AsLua,
impl<L> LuaRead<L> for ()where
L: AsLua,
fn lua_read_at_position(_lua: L, _index: NonZeroI32) -> ReadResult<Self, L>
fn lua_read_at_maybe_zero_position(_lua: L, _index: i32) -> ReadResult<Self, L>
source§impl<L> LuaRead<L> for usizewhere
L: AsLua,
impl<L> LuaRead<L> for usizewhere
L: AsLua,
fn lua_read_at_position(lua: L, index: NonZeroI32) -> ReadResult<usize, L>
source§impl<L> LuaRead<L> for CStringwhere
L: AsLua,
impl<L> LuaRead<L> for CStringwhere
L: AsLua,
fn lua_read_at_position(lua: L, index: NonZeroI32) -> ReadResult<Self, L>
source§impl<L> LuaRead<L> for Stringwhere
L: AsLua,
impl<L> LuaRead<L> for Stringwhere
L: AsLua,
fn lua_read_at_position(lua: L, index: NonZeroI32) -> ReadResult<Self, L>
source§impl<L, A, B> LuaRead<L> for Result<A, B>
impl<L, A, B> LuaRead<L> for Result<A, B>
fn lua_read_at_position( lua: L, index: NonZeroI32, ) -> ReadResult<Result<A, B>, L>
source§impl<L, K, V> LuaRead<L> for HashMap<K, V>
impl<L, K, V> LuaRead<L> for HashMap<K, V>
HashMap