pub enum LuaValue {
    Nil,
    Boolean(bool),
    Number(LuaNumber),
    String(LuaString),
    Table(Rc<RefCell<LuaTable>>),
    Function(Rc<RefCell<LuaFunction>>),
    UserData(Rc<RefCell<LuaUserData>>),
    Thread(Rc<RefCell<LuaThread>>),
}Expand description
Type for any Lua value.
Variants§
Nil
Boolean(bool)
Number(LuaNumber)
String(LuaString)
Table(Rc<RefCell<LuaTable>>)
Function(Rc<RefCell<LuaFunction>>)
UserData(Rc<RefCell<LuaUserData>>)
Thread(Rc<RefCell<LuaThread>>)
Implementations§
Source§impl LuaValue
 
impl LuaValue
Sourcepub fn from_static_str(s: &'static str) -> Self
 
pub fn from_static_str(s: &'static str) -> Self
construct a LuaString from a static string.
Sourcepub fn from_static_slice(s: &'static [u8]) -> Self
 
pub fn from_static_slice(s: &'static [u8]) -> Self
construct a LuaString from a static u8 slice.
Sourcepub fn try_to_int(&self) -> Result<IntType, RuntimeError>
 
pub fn try_to_int(&self) -> Result<IntType, RuntimeError>
try convert this value to a number.
Sourcepub fn try_to_number(&self) -> Result<LuaNumber, RuntimeError>
 
pub fn try_to_number(&self) -> Result<LuaNumber, RuntimeError>
try convert this value to a number.
pub fn is_nil(&self) -> bool
pub fn is_nan(&self) -> bool
Trait Implementations§
Source§impl From<LuaFunction> for LuaValue
 
impl From<LuaFunction> for LuaValue
Source§fn from(f: LuaFunction) -> Self
 
fn from(f: LuaFunction) -> Self
Converts to this type from the input type.
impl Eq for LuaValue
Auto Trait Implementations§
impl Freeze for LuaValue
impl !RefUnwindSafe for LuaValue
impl !Send for LuaValue
impl !Sync for LuaValue
impl Unpin for LuaValue
impl !UnwindSafe for LuaValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
Compare self to 
key and return true if they are equal.