Skip to main content

CallInfo

Struct CallInfo 

Source
pub struct CallInfo {
    pub func: StackIdx,
    pub top: StackIdx,
    pub previous: Option<CallInfoIdx>,
    pub next: Option<CallInfoIdx>,
    pub u: CallInfoFrame,
    pub u2: CallInfoExtra,
    pub nresults: i16,
    pub callstatus: u16,
}
Expand description

Saved state for a Lua or C call frame.

C: struct CallInfo in lstate.h. types.tsv: CallInfo → CallInfo (several fields renamed / adapted).

The C intrusive doubly-linked list (previous, next as raw pointers) is replaced by Option<CallInfoIdx> indices into LuaState::call_info.

Fields§

§func: StackIdx§top: StackIdx§previous: Option<CallInfoIdx>§next: Option<CallInfoIdx>§u: CallInfoFrame§u2: CallInfoExtra§nresults: i16§callstatus: u16

Implementations§

Source§

impl CallInfo

Source

pub fn is_lua(&self) -> bool

Source

pub fn is_lua_code(&self) -> bool

Source

pub fn is_vararg_func(&self) -> bool

Whether the active function is a vararg function.

Currently returns false unconditionally — vararg introspection via debug.getinfo reports no vararg info instead of panicking.

TODO(port): wire when CallInfo carries proto access for vararg detection.

Source

pub fn saved_pc(&self) -> u32

Source

pub fn set_saved_pc(&mut self, pc: u32)

Source

pub fn nextra_args(&self) -> i32

Source

pub fn transfer_ftransfer(&self) -> u16

Source

pub fn transfer_ntransfer(&self) -> u16

Source

pub fn set_trap(&mut self, t: bool)

Source

pub fn recover_status(&self) -> i32

Read the 3-bit recover-status field packed into bits 10-12 of callstatus.

C: #define getcistrecst(ci) (((ci)->callstatus >> CIST_RECST) & 7)

Source

pub fn set_recover_status<T: Into<i32>>(&mut self, status: T)

Write the 3-bit recover-status field. status must fit in three bits.

C: #define setcistrecst(ci,st) (lstate.h)

Source

pub fn get_oah(&self) -> bool

Source

pub fn set_oah(&mut self, allow: bool)

Store the current allowhook value into callstatus bit 0 (CIST_OAH).

C: #define setoah(st,v) ((st) = ((st) & ~CIST_OAH) | (v))

Source

pub fn u_c_old_errfunc(&self) -> isize

Source

pub fn u_c_ctx(&self) -> isize

Source

pub fn u_c_k(&self) -> Option<LuaKFunction>

Source

pub fn set_u_c_k(&mut self, k: Option<LuaKFunction>)

Set continuation function on a C-call frame.

Panics if invoked on a Lua frame (callers must check is_lua() first).

Source

pub fn set_u_c_ctx(&mut self, ctx: isize)

Set continuation context on a C-call frame.

Source

pub fn set_u_c_old_errfunc(&mut self, old_errfunc: isize)

Set saved old_errfunc on a C-call frame.

Source

pub fn set_u2_funcidx(&mut self, idx: i32)

Set the u2.funcidx field, used by yieldable pcall for error recovery.

C: ci->u2.funcidx = cast_int(savestack(L, c.func))

Trait Implementations§

Source§

impl Clone for CallInfo

Source§

fn clone(&self) -> CallInfo

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Default for CallInfo

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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.