mirror of
https://github.com/actix/actix-web.git
synced 2024-12-30 12:00:38 +00:00
move Service to service sub mod
This commit is contained in:
parent
43d6719703
commit
82b71d91ea
16 changed files with 22 additions and 22 deletions
|
@ -11,7 +11,7 @@ use trust_dns_resolver::config::{ResolverConfig, ResolverOpts};
|
||||||
use trust_dns_resolver::system_conf::read_system_conf;
|
use trust_dns_resolver::system_conf::read_system_conf;
|
||||||
|
|
||||||
use super::resolver::{HostAware, Resolver, ResolverError, ResolverFuture};
|
use super::resolver::{HostAware, Resolver, ResolverError, ResolverFuture};
|
||||||
use super::{NewService, Service};
|
use super::service::{NewService, Service};
|
||||||
|
|
||||||
// #[derive(Fail, Debug)]
|
// #[derive(Fail, Debug)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
|
@ -57,14 +57,9 @@ extern crate webpki;
|
||||||
#[cfg(feature = "rust-tls")]
|
#[cfg(feature = "rust-tls")]
|
||||||
extern crate webpki_roots;
|
extern crate webpki_roots;
|
||||||
|
|
||||||
/// re-export for convinience
|
|
||||||
pub use tower_service::{NewService, Service};
|
|
||||||
|
|
||||||
pub mod connector;
|
pub mod connector;
|
||||||
pub mod resolver;
|
pub mod resolver;
|
||||||
pub mod server;
|
pub mod server;
|
||||||
pub mod service;
|
pub mod service;
|
||||||
pub mod ssl;
|
pub mod ssl;
|
||||||
pub mod stream;
|
pub mod stream;
|
||||||
|
|
||||||
pub use service::{IntoNewService, IntoService, NewServiceExt, ServiceExt};
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ use trust_dns_resolver::lookup_ip::LookupIpFuture;
|
||||||
use trust_dns_resolver::system_conf::read_system_conf;
|
use trust_dns_resolver::system_conf::read_system_conf;
|
||||||
use trust_dns_resolver::{AsyncResolver, Background};
|
use trust_dns_resolver::{AsyncResolver, Background};
|
||||||
|
|
||||||
use super::Service;
|
use super::service::Service;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum ResolverError {
|
pub enum ResolverError {
|
||||||
|
|
|
@ -10,6 +10,7 @@ mod worker;
|
||||||
pub use self::server::Server;
|
pub use self::server::Server;
|
||||||
pub use self::services::ServerServiceFactory;
|
pub use self::services::ServerServiceFactory;
|
||||||
|
|
||||||
|
#[allow(unused_imports)]
|
||||||
pub(crate) use self::worker::{Connections, ConnectionsGuard};
|
pub(crate) use self::worker::{Connections, ConnectionsGuard};
|
||||||
|
|
||||||
/// Pause accepting incoming connections
|
/// Pause accepting incoming connections
|
||||||
|
|
|
@ -5,7 +5,7 @@ use futures::{Future, Poll};
|
||||||
use tokio_reactor::Handle;
|
use tokio_reactor::Handle;
|
||||||
use tokio_tcp::TcpStream;
|
use tokio_tcp::TcpStream;
|
||||||
|
|
||||||
use {NewService, Service};
|
use service::{NewService, Service};
|
||||||
|
|
||||||
pub enum ServerMessage {
|
pub enum ServerMessage {
|
||||||
Connect(net::TcpStream),
|
Connect(net::TcpStream),
|
||||||
|
|
|
@ -2,9 +2,8 @@ use std::cell::RefCell;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
use futures::{Async, Future, Poll};
|
use futures::{Async, Future, Poll};
|
||||||
use tower_service::{NewService, Service};
|
|
||||||
|
|
||||||
use super::IntoNewService;
|
use super::{IntoNewService, NewService, Service};
|
||||||
|
|
||||||
/// `AndThen` service combinator
|
/// `AndThen` service combinator
|
||||||
pub struct AndThen<A, B> {
|
pub struct AndThen<A, B> {
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
use futures::{Async, Future, IntoFuture, Poll};
|
use futures::{Async, Future, IntoFuture, Poll};
|
||||||
use {IntoNewService, NewService, Service};
|
|
||||||
|
use super::{IntoNewService, NewService, Service};
|
||||||
|
|
||||||
/// `Apply` service combinator
|
/// `Apply` service combinator
|
||||||
pub struct Apply<T, F, R, Req> {
|
pub struct Apply<T, F, R, Req> {
|
||||||
|
|
|
@ -4,9 +4,8 @@ use futures::{
|
||||||
future::{ok, FutureResult},
|
future::{ok, FutureResult},
|
||||||
Async, IntoFuture, Poll,
|
Async, IntoFuture, Poll,
|
||||||
};
|
};
|
||||||
use tower_service::{NewService, Service};
|
|
||||||
|
|
||||||
use super::{IntoNewService, IntoService};
|
use super::{IntoNewService, IntoService, NewService, Service};
|
||||||
|
|
||||||
pub struct FnService<F, Req, Resp, E, Fut>
|
pub struct FnService<F, Req, Resp, E, Fut>
|
||||||
where
|
where
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
use std::marker;
|
use std::marker;
|
||||||
|
|
||||||
use futures::{Async, Future, IntoFuture, Poll};
|
use futures::{Async, Future, IntoFuture, Poll};
|
||||||
use tower_service::{NewService, Service};
|
|
||||||
|
|
||||||
use super::IntoNewService;
|
use super::{IntoNewService, NewService, Service};
|
||||||
|
|
||||||
pub struct FnStateService<S, F, Req, Resp, Err, Fut>
|
pub struct FnStateService<S, F, Req, Resp, Err, Fut>
|
||||||
where
|
where
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
use futures::{Future, Poll};
|
use futures::{Future, Poll};
|
||||||
use tower_service::Service;
|
|
||||||
|
use super::Service;
|
||||||
|
|
||||||
pub struct FromErr<A, E>
|
pub struct FromErr<A, E>
|
||||||
where
|
where
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
use std::marker;
|
use std::marker;
|
||||||
|
|
||||||
use futures::{Async, Future, Poll};
|
use futures::{Async, Future, Poll};
|
||||||
use {NewService, Service};
|
|
||||||
|
use super::{NewService, Service};
|
||||||
|
|
||||||
/// `Map` service combinator
|
/// `Map` service combinator
|
||||||
pub struct Map<A, F, R> {
|
pub struct Map<A, F, R> {
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
use std::marker;
|
use std::marker;
|
||||||
|
|
||||||
use futures::{Async, Future, Poll};
|
use futures::{Async, Future, Poll};
|
||||||
use tower_service::{NewService, Service};
|
|
||||||
|
use super::{NewService, Service};
|
||||||
|
|
||||||
/// `MapErr` service combinator
|
/// `MapErr` service combinator
|
||||||
pub struct MapErr<A, F, E> {
|
pub struct MapErr<A, F, E> {
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
use std::marker;
|
use std::marker;
|
||||||
|
|
||||||
use futures::{Future, Poll};
|
use futures::{Future, Poll};
|
||||||
use tower_service::NewService;
|
|
||||||
|
use super::NewService;
|
||||||
|
|
||||||
/// `MapInitErr` service combinator
|
/// `MapInitErr` service combinator
|
||||||
pub struct MapInitErr<A, F, E> {
|
pub struct MapInitErr<A, F, E> {
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
use futures::{Future, IntoFuture};
|
use futures::{Future, IntoFuture};
|
||||||
|
|
||||||
|
/// re-export for convinience
|
||||||
|
pub use tower_service::{NewService, Service};
|
||||||
|
|
||||||
mod and_then;
|
mod and_then;
|
||||||
mod apply;
|
mod apply;
|
||||||
mod fn_service;
|
mod fn_service;
|
||||||
|
@ -17,7 +20,6 @@ pub use self::from_err::FromErr;
|
||||||
pub use self::map::{Map, MapNewService};
|
pub use self::map::{Map, MapNewService};
|
||||||
pub use self::map_err::{MapErr, MapErrNewService};
|
pub use self::map_err::{MapErr, MapErrNewService};
|
||||||
pub use self::map_init_err::MapInitErr;
|
pub use self::map_init_err::MapInitErr;
|
||||||
use {NewService, Service};
|
|
||||||
|
|
||||||
pub trait ServiceExt: Service {
|
pub trait ServiceExt: Service {
|
||||||
fn apply<F, R, Req>(self, f: F) -> Apply<Self, F, R, Req>
|
fn apply<F, R, Req>(self, f: F) -> Apply<Self, F, R, Req>
|
||||||
|
|
|
@ -8,7 +8,7 @@ use tokio_openssl::{AcceptAsync, ConnectAsync, SslAcceptorExt, SslConnectorExt,
|
||||||
use super::MAX_CONN_COUNTER;
|
use super::MAX_CONN_COUNTER;
|
||||||
use connector::ConnectionInfo;
|
use connector::ConnectionInfo;
|
||||||
use server::{Connections, ConnectionsGuard};
|
use server::{Connections, ConnectionsGuard};
|
||||||
use {NewService, Service};
|
use service::{NewService, Service};
|
||||||
|
|
||||||
/// Support `SSL` connections via openssl package
|
/// Support `SSL` connections via openssl package
|
||||||
///
|
///
|
||||||
|
|
|
@ -2,7 +2,7 @@ use futures::unsync::mpsc;
|
||||||
use futures::{Async, Future, Poll, Stream};
|
use futures::{Async, Future, Poll, Stream};
|
||||||
use tokio::executor::current_thread::spawn;
|
use tokio::executor::current_thread::spawn;
|
||||||
|
|
||||||
use super::{IntoService, Service};
|
use super::service::{IntoService, Service};
|
||||||
|
|
||||||
pub struct StreamDispatcher<S: Stream, T> {
|
pub struct StreamDispatcher<S: Stream, T> {
|
||||||
stream: S,
|
stream: S,
|
||||||
|
|
Loading…
Reference in a new issue