Skip to main content

is_ipv6_literal_candidate

Function is_ipv6_literal_candidate 

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

Returns true when the input looks like an IPv6 literal candidate.

This is a fast pre-filter: it checks that the string contains only hex digits, colons, and dots, and has at least one colon.

ยงLimitations

  • IPv4-mapped/embedded forms (e.g. ::ffff:192.168.1.1) are not recognised as candidates: the embedded decimal octets are not valid hex digits.
  • Zone IDs (e.g. fe80::1%eth0) are not recognised: % is not in the allowed character set.