pub enum LuaValue {
Nil,
Bool(bool),
Int(i64),
Float(f64),
Str(GcRef<LuaString>),
Table(GcRef<LuaTable>),
Function(LuaClosure),
UserData(GcRef<LuaUserData>),
LightUserData(*mut c_void),
Thread(GcRef<LuaThread>),
}Expand description
The dynamically-typed Lua value. Replaces C’s TValue.
Variants§
Nil
Bool(bool)
Int(i64)
Float(f64)
Str(GcRef<LuaString>)
Table(GcRef<LuaTable>)
Function(LuaClosure)
UserData(GcRef<LuaUserData>)
LightUserData(*mut c_void)
Thread(GcRef<LuaThread>)
Implementations§
Source§impl LuaValue
impl LuaValue
pub fn type_tag(&self) -> LuaType
pub fn type_name(&self) -> &'static str
pub fn is_nil(&self) -> bool
pub fn is_falsy(&self) -> bool
pub fn is_truthy(&self) -> bool
pub fn is_collectable(&self) -> bool
pub fn as_int(&self) -> Option<i64>
pub fn as_float(&self) -> Option<f64>
pub fn as_string(&self) -> Option<&GcRef<LuaString>>
pub fn as_table(&self) -> Option<&GcRef<LuaTable>>
Trait Implementations§
Source§impl Trace for LuaValue
LuaValue — central enum. Variants Nil/Bool/Int/Float/LightUserData carry
no GC; Str/Table/Function/UserData/Thread carry collectable payloads.
impl Trace for LuaValue
LuaValue — central enum. Variants Nil/Bool/Int/Float/LightUserData carry no GC; Str/Table/Function/UserData/Thread carry collectable payloads.
impl Copy 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 UnsafeUnpin 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