#[non_exhaustive]pub struct RouterNatRule {
pub action: Option<RouterNatRuleAction>,
pub description: Option<String>,
pub match: Option<String>,
pub rule_number: Option<u32>,
/* private fields */
}routers only.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.action: Option<RouterNatRuleAction>The action to be enforced for traffic that matches this rule.
description: Option<String>An optional description of this rule.
match: Option<String>CEL expression that specifies the match condition that egress traffic
from a VM is evaluated against. If it evaluates to true, the
corresponding action is enforced.
The following examples are valid match expressions for public NAT:
inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')
destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'
The following example is a valid match expression for private NAT:
nexthop.hub == '//networkconnectivity.googleapis.com/projects/my-project/locations/global/hubs/hub-1'
rule_number: Option<u32>An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT.
Implementations§
Source§impl RouterNatRule
impl RouterNatRule
pub fn new() -> Self
Sourcepub fn set_action<T>(self, v: T) -> Selfwhere
T: Into<RouterNatRuleAction>,
pub fn set_action<T>(self, v: T) -> Selfwhere
T: Into<RouterNatRuleAction>,
Sourcepub fn set_or_clear_action<T>(self, v: Option<T>) -> Selfwhere
T: Into<RouterNatRuleAction>,
pub fn set_or_clear_action<T>(self, v: Option<T>) -> Selfwhere
T: Into<RouterNatRuleAction>,
Sourcepub fn set_description<T>(self, v: T) -> Self
pub fn set_description<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_description<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_description<T>(self, v: Option<T>) -> Self
Sets or clears the value of description.
§Example
let x = RouterNatRule::new().set_or_clear_description(Some("example"));
let x = RouterNatRule::new().set_or_clear_description(None::<String>);Sourcepub fn set_or_clear_match<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_match<T>(self, v: Option<T>) -> Self
Sourcepub fn set_rule_number<T>(self, v: T) -> Self
pub fn set_rule_number<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_rule_number<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_rule_number<T>(self, v: Option<T>) -> Self
Sets or clears the value of rule_number.
§Example
let x = RouterNatRule::new().set_or_clear_rule_number(Some(42_u32));
let x = RouterNatRule::new().set_or_clear_rule_number(None::<u32>);Trait Implementations§
Source§impl Clone for RouterNatRule
impl Clone for RouterNatRule
Source§fn clone(&self) -> RouterNatRule
fn clone(&self) -> RouterNatRule
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more