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§
- Invalid
Translation Prefix - translation prefix length is not 32, 40, 48, 56, 64 or 96, or a /96 prefix sets bits 64 to 71
- IpScopes
- Special-use scope an IP address belongs to.
- Translation
Prefix - An IPv4/IPv6 translation prefix (RFC 6052, Section 2.2): the IPv6 network a translator maps IPv4 addresses into.
Enums§
- Embedded
Ipv4 - IPv4 addresses an IPv6 address carries for a translation or transition mechanism.
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§
- embedded_
ipv4 - The IPv4 addresses
addrembeds in a well-known form: the NAT64 well-known prefix64:ff9b::/96(TranslationPrefix::WELL_KNOWN), IPv4-compatible::/96(other than::and::1), 6to42002::/16or the Teredo prefix2001::/32. - 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. - parse_
ip_ net - Parse an IP network from canonical CIDR syntax or abbreviated IPv4 CIDR syntax commonly emitted by operating-system network configuration APIs.
- scope_
cidrs - The CIDR ranges that make up the given
scopesmask, across IPv4 and IPv6.