mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-27 18:02:58 +01:00
update tests
This commit is contained in:
parent
8fe7ce533c
commit
e8aa73a44b
@ -219,7 +219,7 @@ mod tests {
|
||||
use std::rc::Rc;
|
||||
|
||||
use super::*;
|
||||
use service::{NewServiceExt, Service, ServiceExt};
|
||||
use crate::service::{NewServiceExt, Service, ServiceExt};
|
||||
|
||||
struct Srv1(Rc<Cell<usize>>);
|
||||
impl Service<&'static str> for Srv1 {
|
||||
|
@ -17,7 +17,7 @@ where
|
||||
impl<T, F, In, Out, Request> Apply<T, F, In, Out, Request>
|
||||
where
|
||||
T: Service<Request>,
|
||||
F: FnMut(In, &mut T) -> Out,
|
||||
F: Fn(In, &mut T) -> Out,
|
||||
Out: IntoFuture,
|
||||
{
|
||||
/// Create new `Apply` combinator
|
||||
@ -47,7 +47,7 @@ where
|
||||
impl<T, F, In, Out, Request> Service<In> for Apply<T, F, In, Out, Request>
|
||||
where
|
||||
T: Service<Request, Error = Out::Error>,
|
||||
F: FnMut(In, &mut T) -> Out,
|
||||
F: Fn(In, &mut T) -> Out,
|
||||
Out: IntoFuture,
|
||||
{
|
||||
type Response = <Out::Future as Future>::Item;
|
||||
@ -76,7 +76,7 @@ where
|
||||
impl<T, F, In, Out, Request> ApplyNewService<T, F, In, Out, Request>
|
||||
where
|
||||
T: NewService<Request>,
|
||||
F: FnMut(In, &mut T::Service) -> Out,
|
||||
F: Fn(In, &mut T::Service) -> Out,
|
||||
Out: IntoFuture,
|
||||
{
|
||||
/// Create new `ApplyNewService` new service instance
|
||||
@ -92,7 +92,7 @@ where
|
||||
impl<T, F, In, Out, Request> Clone for ApplyNewService<T, F, In, Out, Request>
|
||||
where
|
||||
T: NewService<Request> + Clone,
|
||||
F: FnMut(Out, &mut T::Service) -> Out + Clone,
|
||||
F: Fn(Out, &mut T::Service) -> Out + Clone,
|
||||
Out: IntoFuture,
|
||||
{
|
||||
fn clone(&self) -> Self {
|
||||
@ -107,7 +107,7 @@ where
|
||||
impl<T, F, In, Out, Request> NewService<In> for ApplyNewService<T, F, In, Out, Request>
|
||||
where
|
||||
T: NewService<Request, Error = Out::Error>,
|
||||
F: FnMut(In, &mut T::Service) -> Out + Clone,
|
||||
F: Fn(In, &mut T::Service) -> Out + Clone,
|
||||
Out: IntoFuture,
|
||||
{
|
||||
type Response = <Out::Future as Future>::Item;
|
||||
@ -125,7 +125,7 @@ where
|
||||
pub struct ApplyNewServiceFuture<T, F, In, Out, Request>
|
||||
where
|
||||
T: NewService<Request>,
|
||||
F: FnMut(In, &mut T::Service) -> Out,
|
||||
F: Fn(In, &mut T::Service) -> Out,
|
||||
Out: IntoFuture,
|
||||
{
|
||||
fut: T::Future,
|
||||
@ -136,7 +136,7 @@ where
|
||||
impl<T, F, In, Out, Request> ApplyNewServiceFuture<T, F, In, Out, Request>
|
||||
where
|
||||
T: NewService<Request>,
|
||||
F: FnMut(In, &mut T::Service) -> Out,
|
||||
F: Fn(In, &mut T::Service) -> Out,
|
||||
Out: IntoFuture,
|
||||
{
|
||||
fn new(fut: T::Future, f: F) -> Self {
|
||||
@ -151,7 +151,7 @@ where
|
||||
impl<T, F, In, Out, Request> Future for ApplyNewServiceFuture<T, F, In, Out, Request>
|
||||
where
|
||||
T: NewService<Request>,
|
||||
F: FnMut(In, &mut T::Service) -> Out,
|
||||
F: Fn(In, &mut T::Service) -> Out,
|
||||
Out: IntoFuture,
|
||||
{
|
||||
type Item = Apply<T::Service, F, In, Out, Request>;
|
||||
@ -171,7 +171,7 @@ mod tests {
|
||||
use futures::future::{ok, FutureResult};
|
||||
use futures::{Async, Future, Poll};
|
||||
|
||||
use service::{
|
||||
use crate::service::{
|
||||
IntoNewService, IntoService, NewService, NewServiceExt, Service, ServiceExt,
|
||||
};
|
||||
|
||||
|
@ -159,7 +159,7 @@ mod tests {
|
||||
use futures::future::{err, FutureResult};
|
||||
|
||||
use super::*;
|
||||
use service::{IntoNewService, NewServiceExt, Service, ServiceExt};
|
||||
use crate::service::{IntoNewService, NewServiceExt, Service, ServiceExt};
|
||||
|
||||
struct Srv;
|
||||
impl Service<()> for Srv {
|
||||
|
@ -189,7 +189,7 @@ mod tests {
|
||||
use futures::future::{ok, FutureResult};
|
||||
|
||||
use super::*;
|
||||
use service::{IntoNewService, NewServiceExt, Service, ServiceExt};
|
||||
use crate::service::{IntoNewService, NewServiceExt, Service, ServiceExt};
|
||||
|
||||
struct Srv;
|
||||
impl Service<()> for Srv {
|
||||
|
@ -190,7 +190,7 @@ mod tests {
|
||||
use futures::future::{err, FutureResult};
|
||||
|
||||
use super::*;
|
||||
use service::{IntoNewService, NewServiceExt, Service, ServiceExt};
|
||||
use crate::service::{IntoNewService, NewServiceExt, Service, ServiceExt};
|
||||
|
||||
struct Srv;
|
||||
|
||||
|
@ -35,7 +35,7 @@ pub trait ServiceExt<Request>: Service<Request> {
|
||||
Self: Sized,
|
||||
T: Service<Req, Error = Out::Error>,
|
||||
I: IntoService<T, Req>,
|
||||
F: FnMut(Self::Response, &mut T) -> Out,
|
||||
F: Fn(Self::Response, &mut T) -> Out,
|
||||
Out: IntoFuture<Error = Self::Error>,
|
||||
{
|
||||
self.and_then(Apply::new(service.into_service(), f))
|
||||
@ -158,7 +158,7 @@ pub trait NewServiceExt<Request>: NewService<Request> {
|
||||
Self: Sized,
|
||||
T: NewService<Req, InitError = Self::InitError, Error = Out::Error>,
|
||||
I: IntoNewService<T, Req>,
|
||||
F: FnMut(Self::Response, &mut T::Service) -> Out + Clone,
|
||||
F: Fn(Self::Response, &mut T::Service) -> Out + Clone,
|
||||
Out: IntoFuture<Error = Self::Error>,
|
||||
{
|
||||
self.and_then(ApplyNewService::new(service, f))
|
||||
|
@ -226,7 +226,7 @@ mod tests {
|
||||
use std::rc::Rc;
|
||||
|
||||
use super::*;
|
||||
use service::{NewServiceExt, ServiceExt};
|
||||
use crate::service::{NewServiceExt, ServiceExt};
|
||||
|
||||
#[derive(Clone)]
|
||||
struct Srv1(Rc<Cell<usize>>);
|
||||
|
@ -6,8 +6,8 @@ use native_tls::{self, Error, HandshakeError, TlsAcceptor};
|
||||
use tokio_io::{AsyncRead, AsyncWrite};
|
||||
|
||||
use super::MAX_CONN_COUNTER;
|
||||
use counter::{Counter, CounterGuard};
|
||||
use service::{NewService, Service};
|
||||
use crate::counter::{Counter, CounterGuard};
|
||||
use crate::service::{NewService, Service};
|
||||
|
||||
/// Support `SSL` connections via native-tls package
|
||||
///
|
||||
|
@ -6,9 +6,9 @@ use tokio_io::{AsyncRead, AsyncWrite};
|
||||
use tokio_openssl::{AcceptAsync, ConnectAsync, SslAcceptorExt, SslConnectorExt, SslStream};
|
||||
|
||||
use super::MAX_CONN_COUNTER;
|
||||
use counter::{Counter, CounterGuard};
|
||||
use resolver::RequestHost;
|
||||
use service::{NewService, Service};
|
||||
use crate::counter::{Counter, CounterGuard};
|
||||
use crate::resolver::RequestHost;
|
||||
use crate::service::{NewService, Service};
|
||||
|
||||
/// Support `SSL` connections via openssl package
|
||||
///
|
||||
|
@ -8,8 +8,8 @@ use tokio_io::{AsyncRead, AsyncWrite};
|
||||
use tokio_rustls::{Accept, TlsAcceptor, TlsStream};
|
||||
|
||||
use super::MAX_CONN_COUNTER;
|
||||
use counter::{Counter, CounterGuard};
|
||||
use service::{NewService, Service};
|
||||
use crate::counter::{Counter, CounterGuard};
|
||||
use crate::service::{NewService, Service};
|
||||
|
||||
/// Support `SSL` connections via rustls package
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user