Skip to main content

Thread

Trait Thread 

Source
pub trait Thread: Runnable {
    // Required method
    fn start(self) -> JoinHandle<Self::Output>;
}
Expand description

An extension trait that provides a method to spawn a thread for a Runnable task.

Required Methods§

Source

fn start(self) -> JoinHandle<Self::Output>

Spawns a new standard library thread to execute the run method.

Returns a JoinHandle that can be used to wait for the thread to finish and extract its Output.

Implementors§

Source§

impl<T: Runnable> Thread for T