Struct junction_api::http::RouteMatch
source · 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.
Implementations§
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 moresource§impl Debug for RouteMatch
impl Debug for RouteMatch
source§impl Default for RouteMatch
impl Default for RouteMatch
source§fn default() -> RouteMatch
fn default() -> RouteMatch
source§impl<'de> Deserialize<'de> for RouteMatch
impl<'de> Deserialize<'de> for RouteMatch
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for RouteMatch
impl PartialEq for RouteMatch
source§impl Serialize for RouteMatch
impl Serialize for RouteMatch
source§impl TryFrom<&HTTPRouteRulesMatches> for RouteMatch
impl TryFrom<&HTTPRouteRulesMatches> for RouteMatch
source§impl TryFrom<&RouteMatch> for HTTPRouteRulesMatches
impl TryFrom<&RouteMatch> for HTTPRouteRulesMatches
impl StructuralPartialEq for RouteMatch
Auto Trait Implementations§
impl Freeze for RouteMatch
impl RefUnwindSafe for RouteMatch
impl Send for RouteMatch
impl Sync for RouteMatch
impl Unpin for RouteMatch
impl UnwindSafe for RouteMatch
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
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)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request