1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-27 22:32:57 +01:00

convert to new service

This commit is contained in:
Nikolay Kim 2018-08-30 09:38:09 -07:00
parent a928d82895
commit 061a0339ff

View File

@ -1,7 +1,7 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use futures::{Async, Future, Poll}; use futures::{Async, Future, Poll};
use {NewService, Service}; use {NewService, Service, IntoNewService};
/// `ApplyService` service combinator /// `ApplyService` service combinator
pub struct ApplyService<T, F, R, Req, Resp, Err> { pub struct ApplyService<T, F, R, Req, Resp, Err> {
@ -70,10 +70,10 @@ where
R: Future<Item = Resp, Error = Err>, R: Future<Item = Resp, Error = Err>,
{ {
/// Create new `Partial` new service instance /// Create new `Partial` new service instance
pub fn new(f: F, service: T) -> Self { pub fn new<F1: IntoNewService<T>>(f: F, service: F1) -> Self {
Self { Self {
service,
f, f,
service: service.into_new_service(),
r: PhantomData, r: PhantomData,
r1: PhantomData, r1: PhantomData,
r2: PhantomData, r2: PhantomData,