Expand description
The ipnetwork
crate provides a set of APIs to work with IP CIDRs in
Rust.
Structs§
- IpNetwork
Iterator - Ipv4
Network - Represents a network range where the IP addresses are of v4
- Ipv4
Network Iterator - Ipv6
Network - Represents a network range where the IP addresses are of v6
- Ipv6
Network Iterator
Enums§
- IpNetwork
- Represents a generic network range. This type can have two variants: the v4 and the v6 case.
- IpNetwork
Error - Represents a bunch of errors that can occur while working with a
IpNetwork
- Network
Size - Represents a generic network size.
- Network
Size Error - Cannot convert an IPv6 network size to a u32 as it is a 128-bit value.
Functions§
- ip_
mask_ to_ prefix - Converts a
IpAddr
network mask into a prefix. If the mask is invalid this will return anIpNetworkError::InvalidPrefix
. - ipv4_
mask_ to_ prefix - Converts a
Ipv4Addr
network mask into a prefix. - ipv6_
mask_ to_ prefix - Converts a
Ipv6Addr
network mask into a prefix. If the mask is invalid this will return anIpNetworkError::InvalidPrefix
.