mirror of https://github.com/fafhrd91/actix-net
use pin_project_lite. remove unused mods. update changelog
This commit is contained in:
parent
3063c8e167
commit
8e94459ff7
|
@ -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.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "actix-utils"
|
||||
version = "2.0.0"
|
||||
version = "3.0.0"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
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 }
|
||||
|
|
|
@ -62,25 +62,28 @@ pub enum Message<T> {
|
|||
Close,
|
||||
}
|
||||
|
||||
/// Dispatcher is a future that reads frames from Framed object
|
||||
/// and passes them to the service.
|
||||
#[pin_project::pin_project]
|
||||
pub struct Dispatcher<S, T, U, I>
|
||||
where
|
||||
S: Service<Request = <U as Decoder>::Item, Response = I>,
|
||||
S::Error: 'static,
|
||||
S::Future: 'static,
|
||||
T: AsyncRead + AsyncWrite,
|
||||
U: Encoder<I> + Decoder,
|
||||
I: 'static,
|
||||
<U as Encoder<I>>::Error: fmt::Debug,
|
||||
{
|
||||
service: S,
|
||||
state: State<S, U, I>,
|
||||
#[pin]
|
||||
framed: Framed<T, U>,
|
||||
rx: mpsc::Receiver<Result<Message<I>, S::Error>>,
|
||||
tx: mpsc::Sender<Result<Message<I>, 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<S, T, U, I>
|
||||
where
|
||||
S: Service<Request = <U as Decoder>::Item, Response = I>,
|
||||
S::Error: 'static,
|
||||
S::Future: 'static,
|
||||
T: AsyncRead,
|
||||
T: AsyncWrite,
|
||||
U: Encoder<I>,
|
||||
U: Decoder,
|
||||
I: 'static,
|
||||
<U as Encoder<I>>::Error: fmt::Debug,
|
||||
{
|
||||
service: S,
|
||||
state: State<S, U, I>,
|
||||
#[pin]
|
||||
framed: Framed<T, U>,
|
||||
rx: mpsc::Receiver<Result<Message<I>, S::Error>>,
|
||||
tx: mpsc::Sender<Result<Message<I>, S::Error>>,
|
||||
}
|
||||
}
|
||||
|
||||
enum State<S: Service, U: Encoder<I> + Decoder, I> {
|
||||
|
|
|
@ -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 {}
|
||||
|
|
|
@ -159,13 +159,14 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
/// `TimeoutService` response future
|
||||
#[pin_project::pin_project]
|
||||
#[derive(Debug)]
|
||||
pub struct TimeoutServiceResponse<T: Service> {
|
||||
#[pin]
|
||||
fut: T::Future,
|
||||
sleep: Delay,
|
||||
pin_project_lite::pin_project! {
|
||||
/// `TimeoutService` response future
|
||||
#[derive(Debug)]
|
||||
pub struct TimeoutServiceResponse<T: Service> {
|
||||
#[pin]
|
||||
fut: T::Future,
|
||||
sleep: Delay,
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Future for TimeoutServiceResponse<T>
|
||||
|
|
Loading…
Reference in New Issue