pub trait VirtualThread<ThreadAccessor: ThreadAccess> {
// Required method
fn new_thread(
&self,
accessor: ThreadAccessor,
runner: ThreadRunner,
) -> Option<NonZero<u32>>;
// Provided method
fn sched_yield<Wasm: WasmAccess + WasmAccessName + 'static>(&self) -> Errno { ... }
}Expand description
Trait for a virtual thread implementation.
Required Methods§
Sourcefn new_thread(
&self,
accessor: ThreadAccessor,
runner: ThreadRunner,
) -> Option<NonZero<u32>>
fn new_thread( &self, accessor: ThreadAccessor, runner: ThreadRunner, ) -> Option<NonZero<u32>>
Creates a new thread and returns its ID.
Provided Methods§
Sourcefn sched_yield<Wasm: WasmAccess + WasmAccessName + 'static>(&self) -> Errno
fn sched_yield<Wasm: WasmAccess + WasmAccessName + 'static>(&self) -> Errno
Yields the execution of the current thread.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".