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§
Source§impl Trace for LuaThread
LuaThread — value-side thread identity. Carries only a ThreadId
(the registry key); the real per-thread LuaState lives in
lua-vm’s GlobalState::threads map and is traced from
GlobalState::trace as a root.
impl Trace for LuaThread
LuaThread — value-side thread identity. Carries only a ThreadId
(the registry key); the real per-thread LuaState lives in
lua-vm’s GlobalState::threads map and is traced from
GlobalState::trace as a root.
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Concrete Rust type name for diagnostic/testC telemetry
(
Heap::type_name_count). Collector behavior must not branch on
this. The default covers container blanket impls, which are never
GC-boxed directly; concrete runtime types override it with
std::any::type_name::<Self>().fn trace(&self, _m: &mut Marker)
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