pub struct Params<'k, 'v> { /* private fields */ }
Expand description
A list of parameters returned by a route match.
let matched = router.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§
Trait Implementations§
source§impl<'k, 'v> Ord for Params<'k, 'v>
impl<'k, 'v> Ord for Params<'k, 'v>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'k, 'v> PartialOrd for Params<'k, 'v>
impl<'k, 'v> PartialOrd for Params<'k, 'v>
impl<'k, 'v> Eq for Params<'k, 'v>
impl<'k, 'v> StructuralPartialEq for Params<'k, 'v>
Auto Trait Implementations§
impl<'k, 'v> Freeze for Params<'k, 'v>
impl<'k, 'v> RefUnwindSafe for Params<'k, 'v>
impl<'k, 'v> Send for Params<'k, 'v>
impl<'k, 'v> Sync for Params<'k, 'v>
impl<'k, 'v> Unpin for Params<'k, 'v>
impl<'k, 'v> UnwindSafe for Params<'k, 'v>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)