#[non_exhaustive]pub struct FirewallRule {
pub priority: i32,
pub action: Action,
pub source_range: String,
pub description: String,
/* private fields */
}Expand description
A single firewall rule that is evaluated against incoming traffic and provides an action to take on matched requests.
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.priority: i32A positive integer between [1, Int32.MaxValue-1] that defines the order of rule evaluation. Rules with the lowest priority are evaluated first.
A default rule at priority Int32.MaxValue matches all IPv4 and IPv6 traffic when no previous rule matches. Only the action of this rule can be modified by the user.
action: ActionThe action to take on matched requests.
source_range: StringIP address or range, defined using CIDR notation, of requests that this
rule applies to. You can use the wildcard character “*” to match all IPs
equivalent to “0/0” and “::/0” together.
Examples: 192.168.1.1 or 192.168.0.0/16 or 2001:db8::/32
or 2001:0db8:0000:0042:0000:8a2e:0370:7334.
description: StringAn optional string description of this rule. This field has a maximum length of 100 characters.
Implementations§
Source§impl FirewallRule
impl FirewallRule
pub fn new() -> Self
Sourcepub fn set_priority<T: Into<i32>>(self, v: T) -> Self
pub fn set_priority<T: Into<i32>>(self, v: T) -> Self
Sets the value of priority.
Sourcepub fn set_action<T: Into<Action>>(self, v: T) -> Self
pub fn set_action<T: Into<Action>>(self, v: T) -> Self
Sets the value of action.
Sourcepub fn set_source_range<T: Into<String>>(self, v: T) -> Self
pub fn set_source_range<T: Into<String>>(self, v: T) -> Self
Sets the value of source_range.
Sourcepub fn set_description<T: Into<String>>(self, v: T) -> Self
pub fn set_description<T: Into<String>>(self, v: T) -> Self
Sets the value of description.
Trait Implementations§
Source§impl Clone for FirewallRule
impl Clone for FirewallRule
Source§fn clone(&self) -> FirewallRule
fn clone(&self) -> FirewallRule
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more