executor: add TypedExecutor (#993)

Adds a `TypedExecutor` trait that describes how to spawn futures of a specific
type. This is useful for implementing functions that are generic over an executor
and wish to support both `Send` and `!Send` cases.
This commit is contained in:
Carl Lerche
2019-03-21 14:30:18 -07:00
committed by GitHub
parent cdde2e7a27
commit b1172f8074
19 changed files with 499 additions and 214 deletions
+2 -1
View File
@@ -2,10 +2,11 @@ extern crate futures;
extern crate tokio_executor;
use futures::{future::lazy, Future};
use tokio_executor::*;
use tokio_executor::DefaultExecutor;
mod out_of_executor_context {
use super::*;
use tokio_executor::Executor;
fn test<F, E>(spawn: F)
where