Skip to main content

traceback

Function traceback 

Source
pub fn traceback(
    state: &mut LuaState,
    other: Option<&mut LuaState>,
    msg: Option<&[u8]>,
    level: i32,
) -> Result<(), LuaError>
Expand description

Build a stack traceback string from thread other starting at level. If msg is non-None it is prepended on its own line. Leaves the result string on top of state.

When other is None, the traceback is built for state itself (the common single-thread case). Rust’s borrow checker forbids passing the same &mut LuaState twice, so we use an Option to express the aliasing intent rather than a separate parameter.