pub enum IpAddress {
Exact(Ipv4Addr),
Cidr(Ipv4Cidr),
}
Expand description
Enumeration to make handling ip addresses vs subnets easier
Variants§
Implementations§
Source§impl IpAddress
impl IpAddress
Sourcepub fn matches(&self, other_address: &Ipv4Addr) -> bool
pub fn matches(&self, other_address: &Ipv4Addr) -> bool
Checks if the other exact ip address is a match for the current ip address specification. An address is a match if the current ip address is an exact one and both are exactly equal, or if the current ip address is a CIDR subnet mask and the other ip address is contained within.
Sourcepub fn parse_comma_delimited_list(
input: Option<&String>,
) -> Result<Vec<IpAddress>, IpAddressParseError>
pub fn parse_comma_delimited_list( input: Option<&String>, ) -> Result<Vec<IpAddress>, IpAddressParseError>
Attempts to parse a string supposedly containing a comma delimited list of ip addresses and cidr values. An empty string will return an empty collection of ips.
Trait Implementations§
impl StructuralPartialEq for IpAddress
Auto Trait Implementations§
impl Freeze for IpAddress
impl RefUnwindSafe for IpAddress
impl Send for IpAddress
impl Sync for IpAddress
impl Unpin for IpAddress
impl UnwindSafe for IpAddress
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.