#[non_exhaustive]pub struct IpRange {
pub ip_range: Option<IpRange>,
/* private fields */
}Expand description
An IP range provided in any one of the supported formats.
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.ip_range: Option<IpRange>Implementations§
Source§impl IpRange
impl IpRange
pub fn new() -> Self
Sourcepub fn set_ip_range<T: Into<Option<IpRange>>>(self, v: T) -> Self
pub fn set_ip_range<T: Into<Option<IpRange>>>(self, v: T) -> Self
Sourcepub fn ip_address(&self) -> Option<&String>
pub fn ip_address(&self) -> Option<&String>
The value of ip_range
if it holds a IpAddress, None if the field is not set or
holds a different branch.
Sourcepub fn set_ip_address<T: Into<String>>(self, v: T) -> Self
pub fn set_ip_address<T: Into<String>>(self, v: T) -> Self
Sourcepub fn ip_address_range(&self) -> Option<&String>
pub fn ip_address_range(&self) -> Option<&String>
The value of ip_range
if it holds a IpAddressRange, None if the field is not set or
holds a different branch.
Sourcepub fn set_ip_address_range<T: Into<String>>(self, v: T) -> Self
pub fn set_ip_address_range<T: Into<String>>(self, v: T) -> Self
Sets the value of ip_range
to hold a IpAddressRange.
Note that all the setters affecting ip_range are
mutually exclusive.
§Example
ⓘ
let x = IpRange::new().set_ip_address_range("example");
assert!(x.ip_address_range().is_some());
assert!(x.ip_address().is_none());
assert!(x.external_address().is_none());Sourcepub fn external_address(&self) -> Option<&String>
pub fn external_address(&self) -> Option<&String>
The value of ip_range
if it holds a ExternalAddress, None if the field is not set or
holds a different branch.
Sourcepub fn set_external_address<T: Into<String>>(self, v: T) -> Self
pub fn set_external_address<T: Into<String>>(self, v: T) -> Self
Sets the value of ip_range
to hold a ExternalAddress.
Note that all the setters affecting ip_range are
mutually exclusive.
§Example
ⓘ
let x = IpRange::new().set_external_address("example");
assert!(x.external_address().is_some());
assert!(x.ip_address().is_none());
assert!(x.ip_address_range().is_none());Trait Implementations§
impl StructuralPartialEq for IpRange
Auto Trait Implementations§
impl Freeze for IpRange
impl RefUnwindSafe for IpRange
impl Send for IpRange
impl Sync for IpRange
impl Unpin for IpRange
impl UnwindSafe for IpRange
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