diff --git a/tower-util/src/lib.rs b/tower-util/src/lib.rs index a9f88b8..bdd6277 100644 --- a/tower-util/src/lib.rs +++ b/tower-util/src/lib.rs @@ -2,6 +2,7 @@ #[cfg(feature = "either")] extern crate either as _either; +#[macro_use] extern crate futures; #[cfg(feature = "io")] extern crate tokio_io; @@ -14,7 +15,9 @@ mod either; #[cfg(feature = "io")] mod make_connection; mod make_service; +mod oneshot; mod option; +mod ready; mod sealed; mod service_fn; @@ -25,7 +28,9 @@ pub use crate::either::EitherService; #[cfg(feature = "io")] pub use crate::make_connection::MakeConnection; pub use crate::make_service::MakeService; +pub use crate::oneshot::Oneshot; pub use crate::option::OptionService; +pub use crate::ready::Ready; pub use crate::service_fn::ServiceFn; pub mod error { diff --git a/tower/src/util/oneshot.rs b/tower-util/src/oneshot.rs similarity index 97% rename from tower/src/util/oneshot.rs rename to tower-util/src/oneshot.rs index fb672c6..9c53e54 100644 --- a/tower/src/util/oneshot.rs +++ b/tower-util/src/oneshot.rs @@ -20,7 +20,7 @@ impl Oneshot where S: Service, { - pub(super) fn new(svc: S, req: Req) -> Self { + pub fn new(svc: S, req: Req) -> Self { Oneshot { state: State::NotReady(svc, req), } diff --git a/tower/src/util/ready.rs b/tower-util/src/ready.rs similarity index 96% rename from tower/src/util/ready.rs rename to tower-util/src/ready.rs index 9a66a74..9287f9e 100644 --- a/tower/src/util/ready.rs +++ b/tower-util/src/ready.rs @@ -16,7 +16,7 @@ impl Ready where T: Service, { - pub(super) fn new(service: T) -> Self { + pub fn new(service: T) -> Self { Ready { inner: Some(service), _p: PhantomData, diff --git a/tower/src/util/mod.rs b/tower/src/util/mod.rs index 9d1d549..aa98964 100644 --- a/tower/src/util/mod.rs +++ b/tower/src/util/mod.rs @@ -5,8 +5,6 @@ mod apply; mod from_err; mod map; mod map_err; -mod oneshot; -mod ready; mod then; pub use self::and_then::AndThen; @@ -14,8 +12,6 @@ pub use self::apply::Apply; pub use self::from_err::FromErr; pub use self::map::Map; pub use self::map_err::MapErr; -pub use self::oneshot::Oneshot; -pub use self::ready::Ready; pub use self::then::Then; // `tower-util` re-exports @@ -23,7 +19,9 @@ pub use tower_util::BoxService; pub use tower_util::CallAll; pub use tower_util::CallAllUnordered; pub use tower_util::EitherService; +pub use tower_util::Oneshot; pub use tower_util::OptionService; +pub use tower_util::Ready; pub use tower_util::ServiceFn; pub use tower_util::UnsyncBoxService;