Expand description

The ipnetwork crate provides a set of APIs to work with IP CIDRs in Rust. Implementation for IPv4 is more or less stable, IPv6 implementation is still WIP.

Structs

Represents a network range where the IP addresses are of v4

Represents a network range where the IP addresses are of v6

Enums

Represents a generic network range. This type can have two variants: the v4 and the v6 case.

Represents a bunch of errors that can occur while working with a IpNetwork

Functions

Converts a IpAddr network mask into a prefix. If the mask is invalid this will return an IpNetworkError::InvalidPrefix.

Converts a Ipv4Addr network mask into a prefix. If the mask is invalid this will return an IpNetworkError::InvalidPrefix.

Converts a Ipv6Addr network mask into a prefix. If the mask is invalid this will return an IpNetworkError::InvalidPrefix.