2020-01-20 04:47:36 +01:00
|
|
|
use crate::Executor;
|
|
|
|
|
|
|
|
|
|
use futures::Future;
|
|
|
|
|
|
2020-01-20 09:49:17 +01:00
|
|
|
/// An executor that drops all the futures, instead of spawning them.
|
|
|
|
|
#[derive(Debug)]
|
2020-01-20 04:47:36 +01:00
|
|
|
pub struct Null;
|
|
|
|
|
|
|
|
|
|
impl Executor for Null {
|
|
|
|
|
fn new() -> Result<Self, futures::io::Error> {
|
|
|
|
|
Ok(Self)
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-05 04:14:26 +01:00
|
|
|
#[cfg(not(target_arch = "wasm32"))]
|
2020-01-20 04:47:36 +01:00
|
|
|
fn spawn(&self, _future: impl Future<Output = ()> + Send + 'static) {}
|
2020-02-05 04:14:26 +01:00
|
|
|
|
|
|
|
|
#[cfg(target_arch = "wasm32")]
|
|
|
|
|
fn spawn(&self, _future: impl Future<Output = ()> + 'static) {}
|
2020-01-20 04:47:36 +01:00
|
|
|
}
|