pub struct Params<'k, 'v> { /* private fields */ }
Expand description
A list of parameters returned by a route match.
let matched = router.at("/users/1")?;
// Iterate through the keys and values.
for (key, value) in matched.params.iter() {
println!("key: {}, value: {}", key, value);
}
// Get a specific value by name.
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)