Module ip
Available on crate feature
net only.Expand description
IP constants and utilities
Modules§
- geo
- IP geolocation: map an
IpAddrto location data. - ipnet
- Re-export of the
ipnetcrate: IPv4/IPv6 network (CIDR) types, exposed so you can name them (e.g. for the typedMmdbBuilder::insert) without adding anipnetdependency of your own. - private
- Helpers for IP ranges that should bypass public-Internet interception.
- scope
- Classify IP addresses into special-use
IpScopesand 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§
- Into
Canonical IpAddr - Converts an IP address into a canonical representation.
Functions§
- ip_
scope - Classify
addrinto the special-useIpScopesit 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
scopesmask, across IPv4 and IPv6.