diff options
Diffstat (limited to 'src/native/executor.rs')
-rw-r--r-- | src/native/executor.rs | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/native/executor.rs b/src/native/executor.rs deleted file mode 100644 index 68a1d280..00000000 --- a/src/native/executor.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! Choose your preferred executor to power your application. -pub use iced_winit::{executor::Null, Executor}; -use iced_winit::{executor::ThreadPool, futures}; - -/// The default cross-platform executor. -/// -/// - On native platforms, it will use a `ThreadPool`. -/// - On the Web, it will use `wasm-bindgen-futures::spawn_local`. -#[derive(Debug)] -pub struct Default(ThreadPool); - -impl Executor for Default { - fn new() -> Result<Self, futures::io::Error> { - Ok(Default(ThreadPool::new()?)) - } - - fn spawn( - &self, - future: impl futures::Future<Output = ()> + Send + 'static, - ) { - self.0.spawn(future); - } -} |