Skip to content

net

Network helpers on std::net and plain text: no I/O, no resolution.

Cargo feature net (enabled by default). To compile only this module:

cargo add helpers4 --no-default-features --features net

or in Cargo.toml:

[dependencies]
helpers4 = { version = "0.0.5", default-features = false, features = ["net"] }

Import path: helpers4::net.

ItemWhat it does
is_public_ipReturns true when ip is a globally reachable unicast address, false for everything that is loopback, private, link-local, shared, documentation, reserved or otherwise not on the public internet.
is_valid_hostnameChecks that hostname is a valid hostname (RFC 1035 and RFC 1123, ASCII only).

Documented on the page of the helper that returns them.

TypeReturned by
HostnameErroris_valid_hostname