Struct luaext::types::generic::LuaGeneric
[−]
[src]
pub struct LuaGeneric { /* fields omitted */ }Represents a generic lua value on the Lua stack
Can represent any possible lua value, and can be converted to a usable value.
Examples
context.push_integer(4); let generic: LuaGeneric = context.get_arg(1).unwrap(); assert_eq!(Some(4), generic.get_value(&mut context));
Methods
impl LuaGeneric[src]
fn new(i: Index) -> LuaGeneric
Create a new LuaGeneric given an index
fn type_of(&self, context: &mut Context) -> Type
Gets the Lua type of this generic object
fn get_value<T: FromLua>(&self, context: &mut Context) -> Option<T>
Convert the contained value of this generic object to a given type
Trait Implementations
impl LuaStackable for LuaGeneric[src]
fn get_pos(&self) -> Index
Get the position of this value on the stack
impl ToLua for LuaGeneric[src]
fn to_lua(&self, state: &mut State)
Pushes a value of type Self onto the stack of a Lua state.
impl FromLua for LuaGeneric[src]
fn from_lua(_: &mut State, index: Index) -> Option<LuaGeneric>
Converts the value on top of the stack of a Lua state to a value of type Option<Self>. Read more