Skip to main content

Module ip

Module ip 

Available on crate feature net only.
Expand description

IP constants and utilities

Modules§

geo
IP geolocation: map an IpAddr to location data.
ipnet
Re-export of the ipnet crate: IPv4/IPv6 network (CIDR) types, exposed so you can name them (e.g. for the typed MmdbBuilder::insert) without adding an ipnet dependency of your own.
private
Helpers for IP ranges that should bypass public-Internet interception.
scope
Classify IP addresses into special-use IpScopes and enumerate the CIDR ranges that make up a scope.

Structs§

IpScopes
Special-use scope an IP address belongs to.

Constants§

IPV4_BROADCAST
An IPv4 address representing the broadcast address: 255.255.255.255.
IPV4_LOCALHOST
An IPv4 address with the address pointing to localhost: 127.0.0.1
IPV4_UNSPECIFIED
An IPv4 address representing an unspecified address: 0.0.0.0
IPV6_ALL_NODES_LINK_LOCAL
The IPv6 All Nodes multicast address in link-local scope, as defined in RFC 4291 Section 2.7.1.
IPV6_ALL_ROUTERS_LINK_LOCAL
The IPv6 All Routers multicast address in link-local scope, as defined in RFC 4291 Section 2.7.1.
IPV6_LOCALHOST
An IPv6 address representing localhost: ::1.
IPV6_UNSPECIFIED
An IPv6 address representing the unspecified address: ::.

Traits§

IntoCanonicalIpAddr
Converts an IP address into a canonical representation.

Functions§

ip_scope
Classify addr into the special-use IpScopes it belongs to.
ipv4_scope
Classify an IPv4 address. See ip_scope.
ipv6_scope
Classify an IPv6 address. See ip_scope.
scope_cidrs
The CIDR ranges that make up the given scopes mask, across IPv4 and IPv6.