Struct LuaState

Source
pub struct LuaState {
    pub node: Rc<RefCell<LuaNode>>,
}

Fields§

§node: Rc<RefCell<LuaNode>>

Implementations§

Source§

impl LuaState

Source

pub fn aux_lib(&mut self)

Source§

impl LuaState

Source

pub fn new() -> Self

Source§

impl LuaState

Source

pub fn execute(&mut self, inst: &Instruction)

Trait Implementations§

Source§

impl AccessApi for LuaState

Source§

fn tp_name(&self, tp: LuaType) -> String

获取类型名

Source§

fn ty_id(&self, idx: isize) -> LuaType

Source§

fn is_none(&self, idx: isize) -> bool

Source§

fn is_nil(&self, idx: isize) -> bool

Source§

fn is_none_or_nil(&self, idx: isize) -> bool

Source§

fn is_boolean(&self, idx: isize) -> bool

Source§

fn is_integer(&self, idx: isize) -> bool

Source§

fn is_number(&self, idx: isize) -> bool

Source§

fn is_string(&self, idx: isize) -> bool

Source§

fn is_rust_fn(&self, idx: isize) -> bool

Source§

fn is_lua_tbl(&self, idx: isize) -> bool

Source§

fn to_boolean(&self, idx: isize) -> bool

Source§

fn to_integer(&self, idx: isize) -> i64

Source§

fn to_integer_x(&self, idx: isize) -> Option<i64>

Source§

fn to_number(&self, idx: isize) -> f64

Source§

fn to_number_x(&self, idx: isize) -> Option<f64>

Source§

fn to_string(&mut self, idx: isize) -> String

Source§

fn to_string_x(&mut self, idx: isize) -> Option<String>

Source§

fn to_rust_fn(&self, idx: isize) -> Option<fn(&mut dyn LuaApi) -> usize>

Source§

fn to_lua_tbl(&self, idx: isize) -> Option<Rc<LuaTable>>

Source§

fn raw_len(&self, idx: isize) -> usize

Source§

impl ArithApi for LuaState

Source§

fn arith(&mut self, op: Arith)

Source§

impl CallApi for LuaState

Source§

fn load(&mut self, chunk: BufReader<File>, chunk_name: &str, _mode: &str)

Source§

fn call(&mut self, n_args: isize, n_results: isize)

Source§

impl Clone for LuaState

Source§

fn clone(&self) -> LuaState

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CompareApi for LuaState

Source§

fn compare(&mut self, idx1: isize, idx2: isize, op: LuaCompare) -> bool

Source§

fn raw_equal(&mut self, idx1: isize, idx2: isize) -> bool

Source§

impl Debug for LuaState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl GetApi for LuaState

Source§

fn new_table(&mut self)

Source§

fn create_table(&mut self, n_arr: usize, n_rec: usize)

Source§

fn get_table(&mut self, idx: isize) -> LuaType

Source§

fn get_field(&mut self, idx: isize, key: String) -> LuaType

Source§

fn get_i(&mut self, idx: isize, i: i64) -> LuaType

Source§

fn get_meta_table(&mut self, idx: isize) -> bool

Source§

fn raw_get(&mut self, idx: isize) -> LuaType

Source§

fn raw_get_i(&mut self, idx: isize, i: i64) -> LuaType

Source§

fn get_global(&mut self, name: String) -> LuaType

Source§

impl MiscApi for LuaState

Source§

fn len(&mut self, idx: isize)

Source§

fn concat(&mut self, n: usize)

Source§

fn next(&mut self, idx: isize) -> bool

Source§

fn error(&mut self) -> isize

Source§

fn pcall(&mut self, n_args: isize, n_results: isize, msgh: isize) -> isize

Source§

impl PushApi for LuaState

Source§

fn push_nil(&mut self)

Source§

fn push_boolean(&mut self, b: bool)

Source§

fn push_integer(&mut self, i: i64)

Source§

fn push_number(&mut self, f: f64)

Source§

fn push_string(&mut self, s: &str)

Source§

fn push_rust_fn(&mut self, f: fn(&mut dyn LuaApi) -> usize)

Source§

fn register(&mut self, name: &str, f: fn(&mut dyn LuaApi) -> usize)

Source§

fn push_global_table(&mut self)

Source§

fn push_rust_closure(&mut self, f: fn(&mut dyn LuaApi) -> usize, n: usize)

Source§

impl SetApi for LuaState

Source§

fn set_table(&mut self, idx: isize)

Source§

fn set_field(&mut self, idx: isize, key: &str)

Source§

fn set_i(&mut self, idx: isize, i: i64)

Source§

fn set_meta_table(&mut self, idx: isize)

Source§

fn raw_set(&mut self, idx: isize)

Source§

fn raw_set_i(&mut self, idx: isize, i: i64)

Source§

fn set_global(&mut self, name: &str)

Source§

impl StackApi for LuaState

Source§

fn get_top(&self) -> isize

Source§

fn abs_index(&self, idx: isize) -> isize

Source§

fn check_stack(&mut self, n: usize) -> bool

Source§

fn pop(&mut self, n: isize)

Source§

fn copy(&mut self, from_idx: isize, to_idx: isize)

Source§

fn push_value(&mut self, idx: isize)

Source§

fn replace(&mut self, idx: isize)

Source§

fn insert(&mut self, idx: isize)

Source§

fn remove(&mut self, idx: isize)

Source§

fn rotate(&mut self, idx: isize, n: isize)

Source§

fn set_top(&mut self, idx: isize)

Source§

impl LuaApi for LuaState

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.