Enum mmids_core::net::IpAddress
source · Expand description
Enumeration to make handling ip addresses vs subnets easier
Variants
Exact(Ipv4Addr)
Cidr(Ipv4Cidr)
Implementations
sourceimpl 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 Eq for IpAddress
impl StructuralEq for IpAddress
impl StructuralPartialEq for IpAddress
Auto Trait Implementations
impl RefUnwindSafe for IpAddress
impl Send for IpAddress
impl Sync for IpAddress
impl Unpin for IpAddress
impl UnwindSafe for IpAddress
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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
. Read moresourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn 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. Read moresourcefn 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. Read moresourceimpl<T> DowncastSync for Twhere
T: Any + Send + Sync,
impl<T> DowncastSync for Twhere
T: Any + Send + Sync,
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.