mirror of
https://github.com/fafhrd91/actix-web
synced 2025-08-31 08:57:00 +02:00
refactor router
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user