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.