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: u16Implementations§
Source§impl CallInfo
impl CallInfo
pub fn is_lua(&self) -> bool
pub fn is_lua_code(&self) -> bool
Sourcepub fn is_vararg_func(&self) -> bool
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.
pub fn saved_pc(&self) -> u32
pub fn set_saved_pc(&mut self, pc: u32)
pub fn nextra_args(&self) -> i32
pub fn transfer_ftransfer(&self) -> u16
pub fn transfer_ntransfer(&self) -> u16
pub fn set_trap(&mut self, t: bool)
Sourcepub fn recover_status(&self) -> i32
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)
Sourcepub fn set_recover_status<T: Into<i32>>(&mut self, status: T)
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)
pub fn get_oah(&self) -> bool
Sourcepub fn set_oah(&mut self, allow: bool)
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))
pub fn u_c_old_errfunc(&self) -> isize
pub fn u_c_ctx(&self) -> isize
pub fn u_c_k(&self) -> Option<LuaKFunction>
Sourcepub fn set_u_c_k(&mut self, k: Option<LuaKFunction>)
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).
Sourcepub fn set_u_c_ctx(&mut self, ctx: isize)
pub fn set_u_c_ctx(&mut self, ctx: isize)
Set continuation context on a C-call frame.
Sourcepub fn set_u_c_old_errfunc(&mut self, old_errfunc: isize)
pub fn set_u_c_old_errfunc(&mut self, old_errfunc: isize)
Set saved old_errfunc on a C-call frame.
Sourcepub fn set_u2_funcidx(&mut self, idx: i32)
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))