Crate ip_network[][src]

Expand description

IPv4 and IPv6 network structs.

Optional features

When using this crate, you can choose to compile with these features:


use std::net::Ipv4Addr;
use ip_network::Ipv4Network;

let ip_network = Ipv4Network::new(Ipv4Addr::new(192, 168, 1, 0), 24)?;
assert_eq!(Ipv4Addr::new(192, 168, 1, 0), ip_network.network_address());
assert_eq!(24, ip_network.netmask());
assert_eq!(254, ip_network.hosts().len());
assert_eq!("", ip_network.to_string());


Support for Diesel PostgreSQL CIDR type.

Ipv4RangeIterator, Ipv4NetworkIterator, and Ipv6NetworkIterator.


IPv4 Network.

IPv6 Network.


Holds IPv4 or IPv6 network.

Errors when creating new IPv4 or IPv6 networks.

Errors from IPv4 or IPv6 network parsing.

IPv6 Multicast Address Scopes.