summaryrefslogtreecommitdiffstats
path: root/futures/src/executor/null.rs
diff options
context:
space:
mode:
Diffstat (limited to 'futures/src/executor/null.rs')
-rw-r--r--futures/src/executor/null.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/futures/src/executor/null.rs b/futures/src/executor/null.rs
new file mode 100644
index 00000000..6d5cf982
--- /dev/null
+++ b/futures/src/executor/null.rs
@@ -0,0 +1,15 @@
+use crate::Executor;
+
+use futures::Future;
+
+/// 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) {}
+}