1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-01-19 07:14:41 +01:00

move BoxFuture to boxed mod

This commit is contained in:
Nikolay Kim 2019-11-27 20:59:36 +06:00
parent c254bb978c
commit af72005159
2 changed files with 5 additions and 4 deletions

View File

@ -1,8 +1,12 @@
use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use futures::future::FutureExt; use futures::future::FutureExt;
use crate::{BoxFuture, Service, ServiceFactory}; use crate::{Service, ServiceFactory};
pub type BoxFuture<I, E> = Pin<Box<dyn Future<Output = Result<I, E>>>>;
pub type BoxService<Req, Res, Err> = pub type BoxService<Req, Res, Err> =
Box<dyn Service<Request = Req, Response = Res, Error = Err, Future = BoxFuture<Res, Err>>>; Box<dyn Service<Request = Req, Response = Res, Error = Err, Future = BoxFuture<Res, Err>>>;

View File

@ -1,6 +1,5 @@
use std::cell::RefCell; use std::cell::RefCell;
use std::future::Future; use std::future::Future;
use std::pin::Pin;
use std::rc::Rc; use std::rc::Rc;
use std::sync::Arc; use std::sync::Arc;
use std::task::{self, Context, Poll}; use std::task::{self, Context, Poll};
@ -26,8 +25,6 @@ pub use self::map_config::{map_config, unit_config, MappedConfig};
pub use self::pipeline::{pipeline, pipeline_factory, Pipeline, PipelineFactory}; pub use self::pipeline::{pipeline, pipeline_factory, Pipeline, PipelineFactory};
pub use self::transform::{apply, Transform}; pub use self::transform::{apply, Transform};
pub type BoxFuture<I, E> = Pin<Box<dyn Future<Output = Result<I, E>>>>;
/// An asynchronous function from `Request` to a `Response`. /// An asynchronous function from `Request` to a `Response`.
pub trait Service { pub trait Service {
/// Requests handled by the service. /// Requests handled by the service.