1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-21 13:15:38 +02:00

added HttpRequest::url_for

This commit is contained in:
Nikolay Kim
2017-12-06 16:26:27 -08:00
parent 8d52e2bbd9
commit 0dd27bd224
9 changed files with 179 additions and 88 deletions

View File

@@ -44,7 +44,7 @@ impl<S> Default for Resource<S> {
}
}
impl<S> Resource<S> where S: 'static {
impl<S> Resource<S> {
pub(crate) fn default_not_found() -> Self {
Resource {
@@ -62,6 +62,9 @@ impl<S> Resource<S> where S: 'static {
pub(crate) fn get_name(&self) -> Option<String> {
if self.name.is_empty() { None } else { Some(self.name.clone()) }
}
}
impl<S: 'static> Resource<S> {
/// Register a new route and return mutable reference to *Route* object.
/// *Route* is used for route configuration, i.e. adding predicates, setting up handler.