pub struct RulePayload {
pub url_path: Option<String>,
pub url_path_op: Option<UrlPathOp>,
pub method: Option<String>,
pub headers: Option<Vec<HeaderConditionPayload>>,
pub body: Option<Vec<BodyConditionPayload>>,
pub respond: RespondPayload,
}Expand description
§Preservation of unspecified fields (5.5.0 guarantee)
Fields set to None are preserved from the existing rule when this
is an UpdateRule call. The headers and body fields use
Option<Vec<_>> to distinguish three states:
None— preserve existing conditions.Some(vec![])— clear all conditions.Some(vec![…])— replace with the given set.
§URL path operator (RFC 001)
url_path_op controls which operator the routing crate uses to
match the given url_path value. When url_path_op is None and
url_path is Some(_), the operator defaults to Equal (5.7.0
behaviour). When url_path is None, both fields are ignored.
§Header and body conditions (RFC 002)
headers and body are optional lists of conditions. Each None
preserves the existing rule’s conditions; each Some(_) replaces
them wholesale (an empty Vec clears them).
Fields§
§url_path: Option<String>§url_path_op: Option<UrlPathOp>URL path match operator (RFC 001). None defaults to Equal.
method: Option<String>§headers: Option<Vec<HeaderConditionPayload>>Header conditions (RFC 002). None = preserve; Some([]) = clear.
body: Option<Vec<BodyConditionPayload>>Body conditions (RFC 002). None = preserve; Some([]) = clear.
respond: RespondPayloadTrait Implementations§
Source§impl Clone for RulePayload
impl Clone for RulePayload
Source§fn clone(&self) -> RulePayload
fn clone(&self) -> RulePayload
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more