1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-30 16:40:21 +02:00

extrat elements of path pattern

This commit is contained in:
Nikolay Kim
2017-12-05 11:31:35 -08:00
parent 3c9b6ea619
commit a83d9b24ae
3 changed files with 43 additions and 19 deletions

View File

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