pub struct Params(pub Vec<Param>);
Expand description
A Vec
of Param
returned by a route match.
There are two ways to retrieve the value of a parameter:
- by the name of the parameter
let user = params.get("user"); // defined by :user or *user
- by the index of the parameter. This way you can also get the name (key)
let third_key = ¶ms[2].key; // the name of the 3rd parameter
let third_value = ¶ms[2].value; // the value of the 3rd parameter
Tuple Fields§
§0: Vec<Param>
Implementations§
Trait Implementations§
impl StructuralPartialEq for Params
Auto Trait Implementations§
impl Freeze for Params
impl RefUnwindSafe for Params
impl Send for Params
impl Sync for Params
impl Unpin for Params
impl UnwindSafe for Params
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