pub struct RouteMatch {
pub path: Option<PathMatch>,
pub headers: Vec<HeaderMatch>,
pub query_params: Vec<QueryParamMatch>,
pub method: Option<Method>,
}
Expand description
Defines the predicate used to match requests to a given action. Multiple
match types are ANDed together; the match will evaluate to true only if all
conditions are satisfied. For example, if a match specifies a path
match
and two query_params
matches, it will match only if the request’s path
matches and both of the query_params
are matches.
The default RouteMatch functions like a path match on the empty prefix, which matches every request.
Fields§
§path: Option<PathMatch>
Specifies a HTTP request path matcher.
headers: Vec<HeaderMatch>
Specifies HTTP request header matchers. Multiple match values are ANDed together, meaning, a request must match all the specified headers.
query_params: Vec<QueryParamMatch>
Specifies HTTP query parameter matchers. Multiple match values are ANDed together, meaning, a request must match all the specified query parameters.
method: Option<Method>
Specifies HTTP method matcher. When specified, this route will be matched only if the request has the specified method.
Trait Implementations§
Source§impl Clone for RouteMatch
impl Clone for RouteMatch
Source§fn clone(&self) -> RouteMatch
fn clone(&self) -> RouteMatch
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more