pub enum LuaValue {
Nil,
Boolean(bool),
Int(IntType),
Float(FloatType),
String(Vec<u8>),
Table(Rc<RefCell<LuaTable>>),
Function(LuaFunction),
UserData(LuaUserData),
Thread(LuaThread),
}Variants§
Nil
Boolean(bool)
Int(IntType)
Float(FloatType)
String(Vec<u8>)
Table(Rc<RefCell<LuaTable>>)
Function(LuaFunction)
UserData(LuaUserData)
Thread(LuaThread)
Implementations§
source§impl LuaValue
impl LuaValue
pub fn to_bool(&self) -> bool
pub fn add(&self, other: &LuaValue) -> Result<LuaValue, RuntimeError>
pub fn sub(&self, other: &LuaValue) -> Result<LuaValue, RuntimeError>
pub fn mul(&self, other: &LuaValue) -> Result<LuaValue, RuntimeError>
pub fn div(&self, other: &LuaValue) -> Result<LuaValue, RuntimeError>
pub fn fdiv(&self, other: &LuaValue) -> Result<LuaValue, RuntimeError>
pub fn modu(&self, other: &LuaValue) -> Result<LuaValue, RuntimeError>
pub fn pow(&self, other: &LuaValue) -> Result<LuaValue, RuntimeError>
pub fn neg(&self) -> Result<LuaValue, RuntimeError>
sourcepub fn strict_to_int(&self) -> Result<IntType, RuntimeError>
pub fn strict_to_int(&self) -> Result<IntType, RuntimeError>
convert float to int, if float has exact integer representation.
pub fn bit_and(&self, other: &LuaValue) -> Result<LuaValue, RuntimeError>
pub fn bit_or(&self, other: &LuaValue) -> Result<LuaValue, RuntimeError>
pub fn bit_xor(&self, other: &LuaValue) -> Result<LuaValue, RuntimeError>
pub fn bit_lshift(&self, other: &LuaValue) -> Result<LuaValue, RuntimeError>
pub fn bit_rshift(&self, other: &LuaValue) -> Result<LuaValue, RuntimeError>
pub fn bit_not(&self) -> Result<LuaValue, RuntimeError>
pub fn eq(&self, other: &LuaValue) -> bool
pub fn eq_raw(&self, other: &LuaValue) -> bool
pub fn lt(&self, other: &LuaValue) -> Result<bool, RuntimeError>
pub fn len(&self) -> Result<IntType, RuntimeError>
pub fn len_raw(&self) -> Result<IntType, RuntimeError>
pub fn concat(&self, other: &LuaValue) -> Result<LuaValue, RuntimeError>
pub fn not(&self) -> LuaValue
pub fn table_index_get(&self, idx: LuaValue) -> Result<LuaValue, RuntimeError>
pub fn is_nil(&self) -> bool
pub fn table_index_set( &mut self, idx: LuaValue, value: LuaValue, ) -> Result<(), RuntimeError>
pub fn table_index_init( &mut self, idx: LuaValue, value: LuaValue, ) -> Result<(), RuntimeError>
pub fn as_key(&self) -> Result<String, RuntimeError>
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.
source§impl From<RefOrValue> for LuaValue
impl From<RefOrValue> for LuaValue
source§fn from(rv: RefOrValue) -> Self
fn from(rv: RefOrValue) -> Self
Converts to this type from the input type.
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)