cidr::parsers

Function parse_cidr

source
pub fn parse_cidr<C, AP>(
    s: &str,
    address_parser: AP,
) -> Result<C, NetworkParseError>
where C: Cidr, AP: Fn(&str) -> Result<C::Address, AddrParseError>,
Expand description

Parse Cidr with custom address parser

If a ‘/’ is found, parse trailing number as prefix length and leading address with address_parser. Otherwise parse address_parser and treat as host (maximum prefix length).