cidr::parsers

Function parse_inet

Source
pub fn parse_inet<I, AP>(
    s: &str,
    address_parser: AP,
) -> Result<I, NetworkParseError>
where I: Inet, AP: Fn(&str) -> Result<I::Address, AddrParseError>,
Expand description

Parse Inet 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).