Skip to main content

BlockingWork

Trait BlockingWork 

Source
pub trait BlockingWork<T>: 'static { }
Expand description

Work withBlocking and launchBlocking run off the UI thread: a closure, or a WorkerJob with its input.

A closure runs on the shared executor’s threads. A browser page has no such thread and a closure cannot cross to a Web Worker, so a closure returns Unsupported there. A worker job’s call runs on every platform: on the executor’s threads, and in a Web Worker in a browser.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<J: WorkerJob> BlockingWork<<J as WorkerJob>::Output> for WorkerCall<J>

Source§

impl<T, F> BlockingWork<T> for F
where T: Send + 'static, F: FnOnce() -> T + Send + 'static,