iced-yoda/futures/src/executor/null.rs

16 lines
326 B
Rust
Raw Normal View History

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)]
pub struct Null;
impl Executor for Null {
fn new() -> Result<Self, futures::io::Error> {
Ok(Self)
}
fn spawn(&self, _future: impl Future<Output = ()> + Send + 'static) {}
}