Struct submillisecond::params::Params
source · pub struct Params { /* private fields */ }
Expand description
A list of parameters returned by a route match.
Extractor example
use submillisecond::router;
use submillisecond::params::Params;
fn params(params: Params) -> String {
let name = params.get("name").unwrap_or("user");
format!("Welcome, {name}")
}
router! {
GET "/:name" => params
}
Implementations§
Trait Implementations§
source§impl FromOwnedRequest for Params
impl FromOwnedRequest for Params
§type Rejection = Infallible
type Rejection = Infallible
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
source§fn from_owned_request(req: RequestContext) -> Result<Self, Self::Rejection>
fn from_owned_request(req: RequestContext) -> Result<Self, Self::Rejection>
Extract from an owned instance of the request.
The first extractor in handlers will use this method, and can help avoid
cloning in many cases.
source§impl Ord for Params
impl Ord for Params
source§impl PartialEq<Params> for Params
impl PartialEq<Params> for Params
source§impl PartialOrd<Params> for Params
impl PartialOrd<Params> for Params
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Params
impl StructuralEq for Params
impl StructuralPartialEq for Params
Auto Trait Implementations§
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