#[non_exhaustive]pub enum NativeReturn {
Return(MultiValue),
Error(Value),
Wait(WaitRequest),
CallLua {
function: Value,
args: MultiValue,
tag: u32,
keep: MultiValue,
},
CallLuaNoYield {
function: Value,
args: MultiValue,
tag: u32,
keep: MultiValue,
},
}Expand description
A native’s results or its next execution request. Calls never recurse into the executor: Lua runs after the callback and its borrows end.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Return(MultiValue)
Return an exact sequence, including nil holes.
Error(Value)
Raise an arbitrary Lua error object.
Wait(WaitRequest)
Suspend until the host completes the VM-issued key.
CallLua
Call a callable Lua value and resume this symbol in a new VM step. Yields may cross this frame whenever the containing thread may yield.
Fields
args: MultiValueThe call’s arguments.
keep: MultiValueValues kept alive until the continuation resumes.
CallLuaNoYield
Call a Lua value behind a non-yielding C-call boundary.
The calling thread reports coroutine.isyieldable() == false until
this call returns. Attempts to yield across it raise Lua’s catchable
attempt to yield across a C-call boundary error in a coroutine, or
attempt to yield from outside a coroutine on the main thread.
Child coroutines may still yield to their resumers. Host waits and fuel
pauses remain allowed, and the boundary survives snapshots taken at
either pause.
Nested CallLua calls cannot relax this restriction. Results, errors,
continuation tags and kept values behave exactly as for Self::CallLua.
Fields
args: MultiValueThe call’s arguments.
keep: MultiValueValues kept alive until the continuation resumes.