Skip to main content

spawn_thread

Function spawn_thread 

Source
pub fn spawn_thread<F, T>(f: F) -> JoinHandle<T>
where F: FnOnce() -> T + Send + 'static, T: Send + 'static,
Expand description

Spawn a thread with test context propagation. If the spawned thread panics and the test uses DetachedPanicPolicy::FailTest (default), the panic will be reported as a test failure after the test body completes.