Enum netaddr::net::IpNetworkExperimental
[-]
[+]
[src]
pub enum IpNetwork { Ipv4Network(IpNetwork), Ipv6Network(IpNetwork), }
Describe an IP network.
Variants
Ipv4Network | |
Ipv6Network |
Methods
impl IpNetwork
fn version(&self) -> IpAddrVersion
Get the corresponding IP address version.
fn address(&self) -> IpAddr
Get the network address for the network.
fn broadcast_address(&self) -> IpAddr
Get the broadcast address for the network.
fn prefix(&self) -> usize
Get the length of the network prefix, in bits.
fn host_prefix(&self) -> usize
Get the length of the host prefix, in bits.
fn num_addresses(&self) -> usize
The total number of addresses in the network.
fn mask(&self) -> IpAddr
Get the mask of the network.
fn range(&self) -> (IpAddr, IpAddr)
Get the hosts range this network have.
fn contains(&self, ip: IpAddr) -> bool
true
if this ip is contained in the network.
fn overlaps(&self, other: IpNetwork) -> bool
true
if this network is partly or wholly contained in other or other is wholly contained in this network.
fn iter(&self) -> Hosts
Iterate over all addresses of this network.
fn hosts_iter(&self) -> Hosts
Iterate over all usable hosts of this network.