Struct Stack

Source
pub struct Stack<MainData, ThreadData>(/* private fields */);

Implementations§

Source§

impl<MainData, ThreadData> Stack<MainData, ThreadData>

Source

pub fn as_ptr(&self) -> *mut lua_State

Source

pub fn main(&self) -> ThreadMain<MainData, ThreadData>

Source

pub fn thread(&self) -> &Thread<MainData, ThreadData>

Source

pub fn error(&self) -> !

Source

pub fn error_msg(&self, msg: impl AsRef<[u8]>) -> !

Source

pub fn abs_idx(&self, idx: i32) -> i32

Source

pub fn get_top(&self) -> i32

Source

pub fn set_top(&self, idx: i32)

Source

pub fn pop(&self, n: i32)

Source

pub fn remove(&self, idx: i32)

Source

pub fn insert(&self, idx: i32)

Source

pub fn replace(&self, idx: i32)

Source

pub fn reserve(&self, n: i32)

Source

pub fn xmove(&self, to: &Thread<MainData, ThreadData>, n: u32)

Source

pub fn xpush(&self, to: &Thread<MainData, ThreadData>, idx: i32)

Source

pub fn push_copy(&self, idx: i32)

Source

pub fn push_nil(&self)

Source

pub fn push_boolean(&self, value: bool)

Source

pub fn push_light_userdata<T>(&self, value: *mut T)

Source

pub fn push_number(&self, value: f64)

Source

pub fn push_vector(&self, v: (f32, f32, f32))

Source

pub fn push_string(&self, s: impl AsRef<[u8]>)

Source

pub fn push_table(&self)

Source

pub fn push_table_with(&self, narr: u32, nrec: u32)

Source

pub fn push_extern_closure_cont( &self, name: &CStr, nups: u32, func: extern "C-unwind" fn(ctx: Context<MainData, ThreadData>) -> FnReturn, cont: extern "C-unwind" fn(ctx: Context<MainData, ThreadData>, status: Status) -> FnReturn, )

Source

pub fn push_extern_closure( &self, name: &CStr, nups: u32, func: extern "C-unwind" fn(ctx: Context<MainData, ThreadData>) -> FnReturn, )

Source

pub fn push_extern_function_cont( &self, name: &CStr, func: extern "C-unwind" fn(ctx: Context<MainData, ThreadData>) -> FnReturn, cont: extern "C-unwind" fn(ctx: Context<MainData, ThreadData>, status: Status) -> FnReturn, )

Source

pub fn push_extern_function( &self, name: &CStr, func: extern "C-unwind" fn(ctx: Context<MainData, ThreadData>) -> FnReturn, )

Source

pub fn push_bytecode(&self, name: &CStr, bytecode: Bytecode<'_>)

Source

pub fn push_userdata<T: Userdata>(&self, value: T)

Source

pub fn push_thread(&self, thread: &Thread<MainData, ThreadData>)

Source

pub fn push_thread_new(&self) -> ThreadRef<MainData, ThreadData>

Source

pub fn push_buffer(&self, size: usize) -> &mut [u8]

Source

pub fn push_ref(&self, r: &Ref<MainData, ThreadData>) -> Type

Source

pub fn type_of(&self, idx: i32) -> Type

Source

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

Source

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

Source

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

Source

pub fn is_light_userdata(&self, idx: i32) -> bool

Source

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

Source

pub fn is_vector(&self, idx: i32) -> bool

Source

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

Source

pub fn is_table(&self, idx: i32) -> bool

Source

pub fn is_function(&self, idx: i32) -> bool

Source

pub fn is_userdata<T: Userdata>(&self, idx: i32) -> bool

Source

pub fn is_thread(&self, idx: i32) -> bool

Source

pub fn is_buffer(&self, idx: i32) -> bool

Source

pub fn to_boolean_unchecked(&self, idx: i32) -> bool

Source

pub fn to_boolean(&self, idx: i32) -> Option<bool>

Source

pub fn to_light_userdata_unchecked<T>(&self, idx: i32) -> *mut T

Source

pub fn to_light_userdata<T>(&self, idx: i32) -> Option<*mut T>

Source

pub fn to_number_unchecked(&self, idx: i32) -> f64

Source

pub fn to_number(&self, idx: i32) -> Option<f64>

Source

pub unsafe fn to_vector_unchecked(&self, idx: i32) -> (f32, f32, f32)

Source

pub fn to_vector(&self, idx: i32) -> Option<(f32, f32, f32)>

Source

pub unsafe fn to_string_slice_unchecked(&self, idx: i32) -> &[u8]

Source

pub fn to_string_slice(&self, idx: i32) -> Option<&[u8]>

Source

pub unsafe fn to_string_str_unchecked(&self, idx: i32) -> Option<&str>

Source

pub fn to_string_str(&self, idx: i32) -> Option<&str>

Source

pub fn to_userdata<T: Userdata>(&self, idx: i32) -> Option<&RefCell<T>>

Source

pub unsafe fn to_thread_unchecked( &self, idx: i32, ) -> ThreadRef<MainData, ThreadData>

Source

pub fn to_thread(&self, idx: i32) -> Option<ThreadRef<MainData, ThreadData>>

Source

pub unsafe fn to_buffer_unchecked(&self, idx: i32) -> &mut [u8]

Source

pub fn to_buffer(&self, idx: i32) -> Option<&mut [u8]>

Source

pub fn to_ref(&self, idx: i32) -> Ref<MainData, ThreadData>

Auto Trait Implementations§

§

impl<MainData, ThreadData> Freeze for Stack<MainData, ThreadData>

§

impl<MainData, ThreadData> RefUnwindSafe for Stack<MainData, ThreadData>
where MainData: RefUnwindSafe, ThreadData: RefUnwindSafe,

§

impl<MainData, ThreadData> !Send for Stack<MainData, ThreadData>

§

impl<MainData, ThreadData> !Sync for Stack<MainData, ThreadData>

§

impl<MainData, ThreadData> Unpin for Stack<MainData, ThreadData>
where MainData: Unpin, ThreadData: Unpin,

§

impl<MainData, ThreadData> UnwindSafe for Stack<MainData, ThreadData>
where MainData: UnwindSafe, ThreadData: UnwindSafe,

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.