#[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
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RouterNatRule
impl Debug for RouterNatRule
Source§impl Default for RouterNatRule
impl Default for RouterNatRule
Source§fn default() -> RouterNatRule
fn default() -> RouterNatRule
Source§impl Message for RouterNatRule
impl Message for RouterNatRule
Source§impl PartialEq for RouterNatRule
impl PartialEq for RouterNatRule
impl StructuralPartialEq for RouterNatRule
Auto Trait Implementations§
impl Freeze for RouterNatRule
impl RefUnwindSafe for RouterNatRule
impl Send for RouterNatRule
impl Sync for RouterNatRule
impl Unpin for RouterNatRule
impl UnsafeUnpin for RouterNatRule
impl UnwindSafe for RouterNatRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request