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,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 112 bytes