cidr::parsers

Function parse_any_cidr

Source
pub fn parse_any_cidr<AP>(
    s: &str,
    address_parser: AP,
) -> Result<AnyIpCidr, NetworkParseError>
where AP: Fn(&str) -> Result<IpAddr, AddrParseError>,
Expand description

Parse AnyIpCidr with custom address parser

If a ‘/’ is found, parse trailing number as prefix length and leading address with address_parser. If input is just "any" returns AnyIpCidr::Any. Otherwise parse address_parser and treat as host (maximum prefix length).