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§
impl Copy for LuaValue
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.
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Concrete Rust type name for diagnostic/testC telemetry
(
Heap::type_name_count). Collector behavior must not branch on
this. The default covers container blanket impls, which are never
GC-boxed directly; concrete runtime types override it with
std::any::type_name::<Self>().fn trace(&self, m: &mut Marker)
Auto Trait Implementations§
impl !RefUnwindSafe for LuaValue
impl !Send for LuaValue
impl !Sync for LuaValue
impl !UnwindSafe for LuaValue
impl Freeze for LuaValue
impl Unpin for LuaValue
impl UnsafeUnpin 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