diff --git a/actix-utils/CHANGES.md b/actix-utils/CHANGES.md index 0abdf9ce..b4d59ed0 100644 --- a/actix-utils/CHANGES.md +++ b/actix-utils/CHANGES.md @@ -1,8 +1,10 @@ # Changes ## Unreleased - 2020-xx-xx -* Upgrade `pin-project` to `1.0`. -* Deprecated `condition`,`either`,`inflight`,`keepalive`,`oneshot`,`order`,`stream` and `time` mod. +* Use `pin-project-lite` to replace `pin-project`. [#229] +* Remove `condition`,`either`,`inflight`,`keepalive`,`oneshot`,`order`,`stream` and `time` mods. [#229] + +[#229]: https://github.com/actix/actix-net/pull/229 ## 2.0.0 - 2020-08-23 * No changes from beta 1. diff --git a/actix-utils/Cargo.toml b/actix-utils/Cargo.toml index 4afbcf79..f5bd5793 100644 --- a/actix-utils/Cargo.toml +++ b/actix-utils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-utils" -version = "2.0.0" +version = "3.0.0" authors = ["Nikolay Kim "] description = "Various network related services and utilities for the Actix ecosystem." keywords = ["network", "framework", "async", "futures"] @@ -20,10 +20,10 @@ actix-codec = "0.3.0" actix-rt = "1.1.1" actix-service = "1.0.6" -futures-core = { version = "0.3.4", default-features = false } -futures-sink = { version = "0.3.4", default-features = false } +futures-core = { version = "0.3.7", default-features = false } +futures-sink = { version = "0.3.7", default-features = false } log = "0.4" -pin-project = "1.0.0" +pin-project-lite = "0.2.0" [dev-dependencies] -futures-util = { version = "0.3.4", default-features = false } +futures-util = { version = "0.3.7", default-features = false } diff --git a/actix-utils/src/dispatcher.rs b/actix-utils/src/dispatcher.rs index c284c8df..c3cb4f16 100644 --- a/actix-utils/src/dispatcher.rs +++ b/actix-utils/src/dispatcher.rs @@ -62,25 +62,28 @@ pub enum Message { Close, } -/// Dispatcher is a future that reads frames from Framed object -/// and passes them to the service. -#[pin_project::pin_project] -pub struct Dispatcher -where - S: Service::Item, Response = I>, - S::Error: 'static, - S::Future: 'static, - T: AsyncRead + AsyncWrite, - U: Encoder + Decoder, - I: 'static, - >::Error: fmt::Debug, -{ - service: S, - state: State, - #[pin] - framed: Framed, - rx: mpsc::Receiver, S::Error>>, - tx: mpsc::Sender, S::Error>>, +pin_project_lite::pin_project! { + /// Dispatcher is a future that reads frames from Framed object + /// and passes them to the service. + pub struct Dispatcher + where + S: Service::Item, Response = I>, + S::Error: 'static, + S::Future: 'static, + T: AsyncRead, + T: AsyncWrite, + U: Encoder, + U: Decoder, + I: 'static, + >::Error: fmt::Debug, + { + service: S, + state: State, + #[pin] + framed: Framed, + rx: mpsc::Receiver, S::Error>>, + tx: mpsc::Sender, S::Error>>, + } } enum State + Decoder, I> { diff --git a/actix-utils/src/lib.rs b/actix-utils/src/lib.rs index 89cc2a0e..4c4f019c 100644 --- a/actix-utils/src/lib.rs +++ b/actix-utils/src/lib.rs @@ -10,20 +10,3 @@ pub mod dispatcher; pub mod mpsc; pub mod task; pub mod timeout; - -#[deprecated(since = "2.1.0", note = "actix_utils::condition has been removed")] -pub mod condition {} -#[deprecated(since = "2.1.0", note = "actix_utils::either has been removed")] -pub mod either {} -#[deprecated(since = "2.1.0", note = "actix_utils::inflight has been removed")] -pub mod inflight {} -#[deprecated(since = "2.1.0", note = "actix_utils::keepalive has been removed")] -pub mod keepalive {} -#[deprecated(since = "2.1.0", note = "actix_utils::oneshot has been removed")] -pub mod oneshot {} -#[deprecated(since = "2.1.0", note = "actix_utils::order has been removed")] -pub mod order {} -#[deprecated(since = "2.1.0", note = "actix_utils::stream has been removed")] -pub mod stream {} -#[deprecated(since = "2.1.0", note = "actix_utils::time has been removed")] -pub mod time {} diff --git a/actix-utils/src/timeout.rs b/actix-utils/src/timeout.rs index 503b0b63..f3489b85 100644 --- a/actix-utils/src/timeout.rs +++ b/actix-utils/src/timeout.rs @@ -159,13 +159,14 @@ where } } -/// `TimeoutService` response future -#[pin_project::pin_project] -#[derive(Debug)] -pub struct TimeoutServiceResponse { - #[pin] - fut: T::Future, - sleep: Delay, +pin_project_lite::pin_project! { + /// `TimeoutService` response future + #[derive(Debug)] + pub struct TimeoutServiceResponse { + #[pin] + fut: T::Future, + sleep: Delay, + } } impl Future for TimeoutServiceResponse