pub enum AsyncReturnValue {
Value(LuaValue),
String(String),
UserData(LuaUserdata),
}Expand description
Return value from an async function.
Because LuaValue strings are GC-managed and can only be created through
the VM, async futures cannot directly construct string LuaValues. Instead,
they return AsyncReturnValues which are converted to LuaValues by the
AsyncThread after the future completes (using the VM’s string interner).
For non-GC types (integers, floats, booleans, nil), the value is stored
directly as a LuaValue. For strings, an owned String is stored and
later interned via vm.create_string(). For userdata, a LuaUserdata is
stored and later GC-allocated via vm.create_userdata().
Variants§
Value(LuaValue)
A value that doesn’t need GC allocation (integer, float, bool, nil, lightuserdata)
String(String)
A string that needs to be interned via the VM’s string pool
UserData(LuaUserdata)
A userdata that needs to be GC-allocated via the VM