[][src]Enum netaddr2::NetAddr

pub enum NetAddr {
    V4(Netv4Addr),
    V6(Netv6Addr),
}

A structure representing an IP network.

Internally using the built-in std::net::IpAddr structures, this is a simple data structure that can be used in a variety of situations.

Variants

An IPv4 network.

An IPv6 network.

Methods

impl NetAddr[src]

pub fn mask(&self) -> IpAddr[src]

Get the "netmask" part of the inner Netv4Addr or the Netv6Addr.

pub fn addr(&self) -> IpAddr[src]

Get the "network" part of the inner Netv4Addr or the Netv6Addr.

Trait Implementations

impl Broadcast for NetAddr[src]

type Output = Option<IpAddr>

impl Contains for NetAddr[src]

impl Merge for NetAddr[src]

type Output = Option<Self>

impl Eq for NetAddr[src]

impl Clone for NetAddr[src]

impl PartialOrd<NetAddr> for NetAddr[src]

impl PartialEq<NetAddr> for NetAddr[src]

impl Ord for NetAddr[src]

impl From<IpAddr> for NetAddr[src]

impl From<Ipv4Addr> for NetAddr[src]

impl From<Ipv6Addr> for NetAddr[src]

impl From<Netv4Addr> for NetAddr[src]

impl From<Netv6Addr> for NetAddr[src]

impl Copy for NetAddr[src]

impl Hash for NetAddr[src]

impl Debug for NetAddr[src]

impl FromStr for NetAddr[src]

type Err = NetAddrError

The associated error which can be returned from parsing.

Auto Trait Implementations

impl Send for NetAddr

impl Unpin for NetAddr

impl Sync for NetAddr

impl UnwindSafe for NetAddr

impl RefUnwindSafe for NetAddr

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]