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
impl<'k, 'v> Params<'k, 'v>
[src]
impl<'k, 'v> Params<'k, 'v>
[src]pub fn get(&self, key: impl AsRef<str>) -> Option<&'v str>
[src]
pub fn get(&self, key: impl AsRef<str>) -> Option<&'v str>
[src]Returns the value of the first parameter registered matched for 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
impl<'k, 'v> Ord for Params<'k, 'v>
[src]
impl<'k, 'v> Ord for Params<'k, 'v>
[src]impl<'k, 'v> PartialOrd<Params<'k, 'v>> for Params<'k, 'v>
[src]
impl<'k, 'v> PartialOrd<Params<'k, 'v>> for Params<'k, 'v>
[src]fn partial_cmp(&self, other: &Params<'k, 'v>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Params<'k, 'v>) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more