mirror of https://github.com/fafhrd91/actix-web
Add links to Resource::default_service. Clarify that a `Route` can be used.
This commit is contained in:
parent
a6f479a6fa
commit
efe87c5bcf
|
@ -313,8 +313,10 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Default service to be used if no matching route could be found.
|
/// Default service to be used if no matching route could be found.
|
||||||
/// By default *405* response get returned. Resource does not use
|
/// You can pass a [`Route`] as default_service.
|
||||||
/// default handler from `App` or `Scope`.
|
///
|
||||||
|
/// If no default service is specified, a `405 Method Not Allowed` response will be returned to the caller.
|
||||||
|
/// [`Resource`] does **not** inherit the default handler specified on the parent [`App`](crate::App) or [`Scope`](crate::web::Scope).
|
||||||
pub fn default_service<F, U>(mut self, f: F) -> Self
|
pub fn default_service<F, U>(mut self, f: F) -> Self
|
||||||
where
|
where
|
||||||
F: IntoServiceFactory<U, ServiceRequest>,
|
F: IntoServiceFactory<U, ServiceRequest>,
|
||||||
|
|
Loading…
Reference in New Issue