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