Struct matchit::Params [−][src]
pub struct Params<'k, 'v> { /* fields omitted */ }
Expand description
A list of parameters returned by a route match.
let matched = matcher.at("/users/1")?; // you can iterate through the keys and values for (key, value) in matched.params.iter() { println!("key: {}, value: {}", key, value); } // or get a specific value by key let id = matched.params.get("id"); assert_eq!(id, Some("1"));
Implementations
Returns the value of the first parameter registered under the given key.
pub fn iter(&self) -> ParamsIter<'_, 'k, 'v>ⓘNotable traits for ParamsIter<'ps, 'k, 'v>
impl<'ps, 'k, 'v> Iterator for ParamsIter<'ps, 'k, 'v> type Item = (&'k str, &'v str);
[src]
pub fn iter(&self) -> ParamsIter<'_, 'k, 'v>ⓘNotable traits for ParamsIter<'ps, 'k, 'v>
impl<'ps, 'k, 'v> Iterator for ParamsIter<'ps, 'k, 'v> type Item = (&'k str, &'v str);
[src]Returns an iterator over the parameters in the list.
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl<'k, 'v> RefUnwindSafe for Params<'k, 'v>
impl<'k, 'v> UnwindSafe for Params<'k, 'v>
Blanket Implementations
Mutably borrows from an owned value. Read more