iced_futures/backend/native/thread_pool.rs
1//! A `ThreadPool` backend.
2
3/// A thread pool executor for futures.
4pub type Executor = futures::executor::ThreadPool;
5
6impl crate::Executor for Executor {
7 fn new() -> Result<Self, futures::io::Error> {
8 futures::executor::ThreadPool::new()
9 }
10
11 fn spawn(&self, future: impl Future<Output = ()> + Send + 'static) {
12 self.spawn_ok(future);
13 }
14
15 fn block_on<T>(&self, future: impl Future<Output = T>) -> T {
16 futures::executor::block_on(future)
17 }
18}
19
20pub mod time {
21 //! Listen and react to time.
22}