Add links to Resource::default_service. Clarify that a `Route` can be used.

This commit is contained in:
Luca P 2022-01-28 09:59:27 +00:00
parent a6f479a6fa
commit efe87c5bcf
1 changed files with 5 additions and 3 deletions

View File

@ -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>,