update changelog. restric fn_service type a little

This commit is contained in:
fakeshadow 2021-01-15 06:14:26 +08:00
parent 4ea4724fa7
commit 6627c6b129
4 changed files with 26 additions and 17 deletions

View File

@ -1,6 +1,9 @@
# Changes
## Unreleased - 2021-xx-xx
* `Router::recognize_mut_checked` take `&self` and return `Option<(&T, ResourceId)>` [#247]
[#247]: https://github.com/actix/actix-net/pull/247
## 0.2.6 - 2021-01-09

View File

@ -1,6 +1,12 @@
# Changes
## Unreleased - 2021-xx-xx
* `Service::poll_ready` and `Service::call` take `&self`. [#247]
* `apply_fn` and `apply_fn_factory` would take `Fn(Req, &Service)` function type [#247]
* `apply_cfg` and `apply_cfg_factory` would take `Fn(Req, &Service)` function type [#247]
* `fn_service` module would take `Fn(Req)` function type. [#247]
[#247]: https://github.com/actix/actix-net/pull/247
## 2.0.0-beta.3 - 2021-01-09

View File

@ -103,7 +103,7 @@ where
pub struct FnService<F, Fut, Req, Res, Err>
where
F: Fn(Req) -> Fut,
F: FnMut(Req) -> Fut,
Fut: Future<Output = Result<Res, Err>>,
{
f: F,
@ -112,7 +112,7 @@ where
impl<F, Fut, Req, Res, Err> FnService<F, Fut, Req, Res, Err>
where
F: Fn(Req) -> Fut,
F: FnMut(Req) -> Fut,
Fut: Future<Output = Result<Res, Err>>,
{
pub(crate) fn new(f: F) -> Self {
@ -122,7 +122,7 @@ where
impl<F, Fut, Req, Res, Err> Clone for FnService<F, Fut, Req, Res, Err>
where
F: Fn(Req) -> Fut + Clone,
F: FnMut(Req) -> Fut + Clone,
Fut: Future<Output = Result<Res, Err>>,
{
fn clone(&self) -> Self {

View File

@ -172,13 +172,13 @@ where
factory: I,
) -> PipelineFactory<
impl ServiceFactory<
Req,
Response = SF1::Response,
Error = SF::Error,
Config = SF::Config,
InitError = SF::InitError,
Service = impl Service<Req, Response = SF1::Response, Error = SF::Error> + Clone,
> + Clone,
Req,
Response = SF1::Response,
Error = SF::Error,
Config = SF::Config,
InitError = SF::InitError,
Service = impl Service<Req, Response = SF1::Response, Error = SF::Error> + Clone,
> + Clone,
Req,
>
where
@ -209,13 +209,13 @@ where
factory: I,
) -> PipelineFactory<
impl ServiceFactory<
Req,
Response = SF1::Response,
Error = SF::Error,
Config = SF::Config,
InitError = SF::InitError,
Service = impl Service<Req, Response = SF1::Response, Error = SF::Error> + Clone,
> + Clone,
Req,
Response = SF1::Response,
Error = SF::Error,
Config = SF::Config,
InitError = SF::InitError,
Service = impl Service<Req, Response = SF1::Response, Error = SF::Error> + Clone,
> + Clone,
Req,
>
where