pub trait ThreadLifecycle: Sealed {
// Required methods
unsafe fn allocation_size(&self) -> usize;
unsafe fn new_thread_internal(&self) -> VmErrorResult<Thread>;
unsafe fn free_thread(&self, thread: &Thread, page: LuaPage);
}Expand description
Unstable thread allocation and lifecycle capability.
§Safety
Thread, page, and parent handles must be live and belong to the same VM. Initialization and destruction must occur exactly once in the required order, and no outstanding handle may be used after a state is freed.
Required Methods§
Sourceunsafe fn allocation_size(&self) -> usize
unsafe fn allocation_size(&self) -> usize
thread-owned allocation size
Sourceunsafe fn new_thread_internal(&self) -> VmErrorResult<Thread>
unsafe fn new_thread_internal(&self) -> VmErrorResult<Thread>
luaE_newthread
Sourceunsafe fn free_thread(&self, thread: &Thread, page: LuaPage)
unsafe fn free_thread(&self, thread: &Thread, page: LuaPage)
luaE_freethread
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".