Skip to main content

is_host_and_port

Function is_host_and_port 

Source
pub fn is_host_and_port(s: &str) -> bool
Expand description

Hostname plus :port (0..=65535).

Port must be plain digits with no leading zeros (except the single “0”) and no sign. Parses via http::uri::Authority, then applies protovalidate’s stricter checks (exact round-trip — rejects userinfo @, forces canonical port spelling, and requires the host to be a hostname, IPv4, or bracketed IPv6).