Skip to main content

ThreadLifecycle

Trait ThreadLifecycle 

Source
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§

Source

unsafe fn allocation_size(&self) -> usize

thread-owned allocation size

Source

unsafe fn new_thread_internal(&self) -> VmErrorResult<Thread>

luaE_newthread

Source

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".

Implementors§