1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 08:57:00 +02:00

refactor router

This commit is contained in:
Nikolay Kim
2018-07-15 15:12:21 +06:00
parent cf976d296f
commit da915972c0
11 changed files with 635 additions and 655 deletions

View File

@@ -61,6 +61,10 @@ impl Params {
self.tail = tail;
}
pub(crate) fn set_url(&mut self, url: Url) {
self.url = url;
}
pub(crate) fn add(&mut self, name: Rc<String>, value: ParamItem) {
self.segments.push((name, value));
}
@@ -99,6 +103,11 @@ impl Params {
}
}
/// Get unprocessed part of path
pub fn unprocessed(&self) -> &str {
&self.url.path()[(self.tail as usize)..]
}
/// Get matched `FromParam` compatible parameter by name.
///
/// If keyed parameter is not available empty string is used as default