#[non_exhaustive]pub struct WhenView {
pub url_path: Option<UrlPathView>,
pub method: Option<String>,
pub headers: Vec<HeaderConditionView>,
pub body: Vec<BodyConditionView>,
}Expand description
Structured representation of a rule’s when clause (spec §5.3).
§RFC 004 — Structured WhenView
The boolean has_header_conditions / has_body_conditions flags
from 5.3.0 are replaced with typed Vec fields. The GUI can now
render the full list of conditions in a rule list without a second
query. Use headers.is_empty() / body.is_empty() wherever the
old boolean flags were checked.
§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”.
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. None when the rule has no URL-path constraint.
method: Option<String>HTTP method — uppercase string like "GET".
headers: Vec<HeaderConditionView>Structured header conditions (RFC 004). Empty when none.
body: Vec<BodyConditionView>Structured body conditions (RFC 004). Empty when none.