cidr::parsers

Function parse_cidr_full

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

Parse Cidr with custom address and network (when no ‘/’ separator was found) parser

If a ‘/’ is found, parse trailing number as prefix length and leading address with address_parser. Otherwise parse with host_parser.