#[non_exhaustive]pub struct WhenView {
pub url_path: Option<UrlPathView>,
pub method: Option<String>,
pub has_header_conditions: bool,
pub has_body_conditions: bool,
}Expand description
Structured representation of a rule’s when clause (spec §5.3).
§Why each field is Option
A rule with when.request.url_path = "/api" and no other clauses
matches every request whose URL is /api, regardless of method or
headers. Carrying explicit Nones for unset fields keeps the
distinction between “not constrained” and “constrained to empty”
— the GUI renders the former as a blank field and the latter as
“method = (none)”.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.url_path: Option<UrlPathView>URL-path predicate as written in the rule. Carries the matching
operator (equals / starts_with / contains / wild_card
/ pattern).
method: Option<String>HTTP method — uppercase string like "GET" to match the
underlying HttpMethod::as_str() representation.
has_header_conditions: booltrue iff the rule restricts on request headers. We don’t
surface the actual header conditions yet (the routing crate’s
Headers type isn’t publicly inspectable at this stage); the
boolean tells the GUI whether to render a “headers constraint
present” badge.
has_body_conditions: booltrue iff the rule restricts on request body JSON.