#[non_exhaustive]pub struct IpRule {
pub protocol: String,
pub port_ranges: Vec<PortRange>,
/* private fields */
}Expand description
IP rule information.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.protocol: StringThe IP protocol this rule applies to. This value can either be one of the following well known protocol strings (TCP, UDP, ICMP, ESP, AH, IPIP, SCTP) or a string representation of the integer value.
port_ranges: Vec<PortRange>Optional. An optional list of ports to which this rule applies. This field is only applicable for the UDP or (S)TCP protocols. Each entry must be either an integer or a range including a min and max port number.
Implementations§
Source§impl IpRule
impl IpRule
pub fn new() -> Self
Sourcepub fn set_protocol<T: Into<String>>(self, v: T) -> Self
pub fn set_protocol<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_port_ranges<T, V>(self, v: T) -> Self
pub fn set_port_ranges<T, V>(self, v: T) -> Self
Sets the value of port_ranges.
§Example
ⓘ
use google_cloud_securitycenter_v2::model::ip_rule::PortRange;
let x = IpRule::new()
.set_port_ranges([
PortRange::default()/* use setters */,
PortRange::default()/* use (different) setters */,
]);Trait Implementations§
impl StructuralPartialEq for IpRule
Auto Trait Implementations§
impl Freeze for IpRule
impl RefUnwindSafe for IpRule
impl Send for IpRule
impl Sync for IpRule
impl Unpin for IpRule
impl UnwindSafe for IpRule
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
Mutably borrows from an owned value. Read more