2022-01-28 18:24:07 +07:00
|
|
|
//! A backend that does nothing!
|
2025-04-02 10:39:27 +02:00
|
|
|
use crate::MaybeSend;
|
2020-01-20 04:47:36 +01:00
|
|
|
|
2020-01-20 09:49:17 +01:00
|
|
|
/// An executor that drops all the futures, instead of spawning them.
|
|
|
|
|
#[derive(Debug)]
|
2022-01-28 18:24:07 +07:00
|
|
|
pub struct Executor;
|
2020-01-20 04:47:36 +01:00
|
|
|
|
2022-01-28 18:24:07 +07:00
|
|
|
impl crate::Executor for Executor {
|
2020-01-20 04:47:36 +01:00
|
|
|
fn new() -> Result<Self, futures::io::Error> {
|
|
|
|
|
Ok(Self)
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-02 10:39:27 +02:00
|
|
|
fn spawn(&self, _future: impl Future<Output = ()> + MaybeSend + 'static) {}
|
2025-04-02 20:33:22 +02:00
|
|
|
|
|
|
|
|
#[cfg(not(target_arch = "wasm32"))]
|
|
|
|
|
fn block_on<T>(&self, _future: impl Future<Output = T>) -> T {
|
|
|
|
|
unimplemented!()
|
|
|
|
|
}
|
2020-01-20 04:47:36 +01:00
|
|
|
}
|
2022-02-01 11:40:58 +07:00
|
|
|
|
|
|
|
|
pub mod time {
|
|
|
|
|
//! Listen and react to time.
|
|
|
|
|
}
|