lua_ir

Struct LuaEnv

source
pub struct LuaEnv { /* private fields */ }

Implementations§

source§

impl LuaEnv

source

pub fn new(chunk: Chunk) -> LuaEnv

source

pub fn main_thread(&self) -> &Rc<RefCell<LuaThread>>

source

pub fn running_thread(&self) -> &Rc<RefCell<LuaThread>>

source

pub fn push(&self, value: LuaValue)

source

pub fn push2(&self, value1: LuaValue, value2: LuaValue)

source

pub fn push3(&self, value1: LuaValue, value2: LuaValue, value3: LuaValue)

source

pub fn pop(&self) -> LuaValue

source

pub fn pop2(&self) -> (LuaValue, LuaValue)

source

pub fn pop3(&self) -> (LuaValue, LuaValue, LuaValue)

source

pub fn pop4(&self) -> (LuaValue, LuaValue, LuaValue, LuaValue)

source

pub fn pop_n(&self, n: usize)

source

pub fn top(&self) -> LuaValue

source

pub fn top_i(&self, i: usize) -> LuaValue

get i’th value from top of the stack

source

pub fn borrow_running_thread(&self) -> Ref<'_, LuaThread>

source

pub fn borrow_running_thread_mut(&self) -> RefMut<'_, LuaThread>

source

pub fn get_metavalue(&self, value: &LuaValue, key: &str) -> Option<LuaValue>

source

pub fn tostring(&mut self) -> Result<(), RuntimeError>

string-fy a value

source

pub fn add(&mut self) -> Result<(), RuntimeError>

add operation with __add metamethod

source

pub fn sub(&mut self) -> Result<(), RuntimeError>

sub operation with __sub metamethod

source

pub fn mul(&mut self) -> Result<(), RuntimeError>

mul operation with __mul metamethod

source

pub fn div(&mut self) -> Result<(), RuntimeError>

div operation with __div metamethod

source

pub fn mod_(&mut self) -> Result<(), RuntimeError>

mod operation with __mod metamethod

source

pub fn pow(&mut self) -> Result<(), RuntimeError>

pow operation with __pow metamethod

source

pub fn unm(&mut self) -> Result<(), RuntimeError>

unary minus operation with __unm metamethod

source

pub fn idiv(&mut self) -> Result<(), RuntimeError>

floor division operation with __idiv metamethod

source

pub fn band(&mut self) -> Result<(), RuntimeError>

bitwise and operation with __band metamethod

source

pub fn bor(&mut self) -> Result<(), RuntimeError>

bitwise or operation with __bor metamethod

source

pub fn bxor(&mut self) -> Result<(), RuntimeError>

bitwise xor operation with __bxor metamethod

source

pub fn shl(&mut self) -> Result<(), RuntimeError>

bitwise shift left operation with __shl metamethod

source

pub fn shr(&mut self) -> Result<(), RuntimeError>

bitwise shift right operation with __shr metamethod

source

pub fn bnot(&mut self) -> Result<(), RuntimeError>

bitwise not operation with __bnot metamethod

source

pub fn concat(&mut self) -> Result<(), RuntimeError>

concat operation with __concat metamethod

source

pub fn len(&mut self) -> Result<(), RuntimeError>

# length operation with __len metamethod

source

pub fn index(&mut self) -> Result<(), RuntimeError>

table index get operation with __index metamethod

source

pub fn newindex(&mut self) -> Result<(), RuntimeError>

table index set operation with __newindex metamethod

source

pub fn eq(&mut self) -> Result<(), RuntimeError>

equality operation with __eq metamethod

source

pub fn lt(&mut self) -> Result<(), RuntimeError>

less than operation with __lt metamethod

source

pub fn le(&mut self) -> Result<(), RuntimeError>

less than or equal operation with __le metamethod

source

pub fn function_call( &mut self, args_num: usize, func: LuaValue, expected_ret: Option<usize>, force_wait: bool, ) -> Result<(), RuntimeError>

function call with __call metamethod. if force_wait is true, this does not return until the function call is finished. that is, if force_wait is false, this function just pushes data to the function-call-stack, and returns. user must call run_instruction to actually run the function.

source

pub fn run_instruction( &mut self, instruction: Instruction, ) -> Result<(), RuntimeError>

execute single instruction

source

pub fn cycle(&mut self) -> Result<bool, RuntimeError>

source

pub fn run(&mut self) -> Result<(), RuntimeError>

run the whole chunk

Auto Trait Implementations§

§

impl Freeze for LuaEnv

§

impl !RefUnwindSafe for LuaEnv

§

impl !Send for LuaEnv

§

impl !Sync for LuaEnv

§

impl Unpin for LuaEnv

§

impl !UnwindSafe for LuaEnv

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V