Skip to main content

co_wrap

Function co_wrap 

Source
pub fn co_wrap(state: &mut LuaState) -> Result<usize, LuaError>
Expand description

coroutine.wrap(f) — create a coroutine and return a resuming function.

The returned function, when called, resumes the coroutine as if by coroutine.resume, but raises an error rather than returning false.

Captures the new coroutine thread as upvalue 1 of aux_wrap.