[][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>

The type of the broadcast address

impl Clone for NetAddr[src]

impl Contains for NetAddr[src]

impl Copy for NetAddr[src]

impl Debug for NetAddr[src]

impl<'de> Deserialize<'de> for NetAddr[src]

impl Display for NetAddr[src]

impl Eq 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 FromStr for NetAddr[src]

type Err = Error

The associated error which can be returned from parsing.

impl Hash for NetAddr[src]

impl Merge for NetAddr[src]

type Output = Option<Self>

The type of the result of the merge

impl Ord for NetAddr[src]

impl PartialEq<NetAddr> for NetAddr[src]

impl PartialOrd<NetAddr> for NetAddr[src]

impl Serialize for NetAddr[src]

impl StructuralEq for NetAddr[src]

impl StructuralPartialEq for NetAddr[src]

Auto Trait Implementations

impl RefUnwindSafe for NetAddr

impl Send for NetAddr

impl Sync for NetAddr

impl Unpin for NetAddr

impl UnwindSafe for NetAddr

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.