pub struct RouteRule {
pub name: Option<Name>,
pub matches: Vec<RouteMatch>,
pub timeouts: Option<RouteTimeouts>,
pub retry: Option<RouteRetry>,
pub backends: Vec<BackendRef>,
/* private fields */
}
Expand description
A RouteRule contains a set of matches that define which requests it applies to, processing rules, and the final destination(s) for matching traffic.
See the Junction docs for a high level description of how Routes and RouteRules behave.
§Ordering Rules
Route rules may be ordered by comparing their maximum matches, breaking ties by comparing their next-highest match. This provides a total ordering on rules. Note that having a sorted list of rules does not mean that the list of all matches across all rules is totally sorted.
This ordering is provided for convenience - clients match rules in the order they’re listed in a Route.
Fields§
§name: Option<Name>
A human-readable name for this rule.
This name is completely optional, and will only be used in diagnostics to make it easier to debug. Diagnostics that don’t have a name will be referred to by their index in a Route’s list of rules.
matches: Vec<RouteMatch>
A list of match rules applied to an outgoing request. Each match is independent; this rule will be matched if any of the listed matches is satisfied.
If no matches are specified, this Rule matches any outgoing request.
timeouts: Option<RouteTimeouts>
§retry: Option<RouteRetry>
How to retry requests. If not specified, requests are not retried.
backends: Vec<BackendRef>
Where the traffic should route if this rule matches.
If no backends are specified, this route becomes a black hole for traffic and all matching requests return an error.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RouteRule
impl<'de> Deserialize<'de> for RouteRule
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 Ord for RouteRule
impl Ord for RouteRule
Source§impl PartialOrd for RouteRule
impl PartialOrd for RouteRule
impl Eq for RouteRule
impl StructuralPartialEq for RouteRule
Auto Trait Implementations§
impl Freeze for RouteRule
impl RefUnwindSafe for RouteRule
impl Send for RouteRule
impl Sync for RouteRule
impl Unpin for RouteRule
impl UnwindSafe for RouteRule
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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