pub struct LuaThread {
pub id: u64,
}Expand description
Identity of a Lua thread (coroutine).
The real per-thread LuaState lives in lua-vm and is held by
GlobalState keyed by this id. LuaValue::Thread carries a
GcRef<LuaThread> so that pointer-equality of the wrapping GcRef
still implements thread-identity comparison, but the only payload is
the registry key — keeping LuaState outside lua-types avoids the
lua-types → lua-vm crate cycle.
Convention: id == 0 is reserved for the main thread. Coroutines are
assigned ids starting at 1.
Fields§
§id: u64Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LuaThread
impl RefUnwindSafe for LuaThread
impl Send for LuaThread
impl Sync for LuaThread
impl Unpin for LuaThread
impl UnsafeUnpin for LuaThread
impl UnwindSafe for LuaThread
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more