mirror of
https://github.com/actix/actix-web.git
synced 2024-12-30 12:00:38 +00:00
tune App::default_resource signature
This commit is contained in:
parent
f71354783e
commit
0de47211b2
1 changed files with 8 additions and 5 deletions
13
src/app.rs
13
src/app.rs
|
@ -426,12 +426,15 @@ where
|
|||
///
|
||||
/// Default resource works with resources only and does not work with
|
||||
/// custom services.
|
||||
pub fn default_resource<F, R, U>(mut self, f: F) -> Self
|
||||
pub fn default_resource<F, U>(mut self, f: F) -> Self
|
||||
where
|
||||
F: FnOnce(Resource<P>) -> R,
|
||||
R: IntoNewService<U, ServiceRequest<P>>,
|
||||
U: NewService<ServiceRequest<P>, Response = ServiceResponse, Error = ()>
|
||||
+ 'static,
|
||||
F: FnOnce(Resource<P>) -> Resource<P, U>,
|
||||
U: NewService<
|
||||
ServiceRequest<P>,
|
||||
Response = ServiceResponse,
|
||||
Error = (),
|
||||
InitError = (),
|
||||
> + 'static,
|
||||
{
|
||||
// create and configure default resource
|
||||
self.default = Some(Rc::new(boxed::new_service(
|
||||
|
|
Loading…
Reference in a new issue