pub struct Params { /* private fields */ }
Expand description
Route match information
If resource path contains variable patterns, Params
stores this variables.
Implementations
sourceimpl Params
impl Params
sourcepub fn get(&self, key: &str) -> Option<&str>
pub fn get(&self, key: &str) -> Option<&str>
Get matched parameter by name without type conversion
sourcepub fn unprocessed(&self) -> &str
pub fn unprocessed(&self) -> &str
Get unprocessed part of path
sourcepub fn query<T: FromParam>(&self, key: &str) -> Result<T, <T as FromParam>::Err>
pub fn query<T: FromParam>(&self, key: &str) -> Result<T, <T as FromParam>::Err>
Get matched FromParam
compatible parameter by name.
If keyed parameter is not available empty string is used as default value.
fn index(req: HttpRequest) -> Result<String> {
let ivalue: isize = req.match_info().query("val")?;
Ok(format!("isuze value: {:?}", ivalue))
}
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Params
impl !Send for Params
impl !Sync for Params
impl Unpin for Params
impl UnwindSafe for Params
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more