Module parsers

Module parsers 

Source
Expand description

Extra parsers

The FromStr implementations in this crate are rather strict about the allowed input. Depending on the data format that needs to be handled the functions here might help implementing custom parsers.

The parser combinators that take an address_parser can either take FromStr::from_str or a non-default parser like parse_loose_ip. They are used to parse addresses (either as part of a "/" separated notation or as single host).

Parser combinators that take an additional host_parser use that to parse strings that don’t have an "/" separator - usually these should return Cidr/Inet “host” values, but they can allow special syntax like parse_short_ip_cidr to represent non-host networks too.

Functions§

inet_addr
Parse “loose” IPv4 address similar to POSIX inet_addr
parse_any_cidr
Parse AnyIpCidr with custom address parser
parse_any_cidr_full
Parse AnyIpCidr with custom address and network (when no ‘/’ separator was found) parser
parse_any_cidr_full_ignore_hostbits
Parse AnyIpCidr with custom address and network (when no ‘/’ separator was found) parser
parse_any_cidr_ignore_hostbits
Parse AnyIpCidr with custom address parser
parse_cidr
Parse Cidr with custom address parser
parse_cidr_full
Parse Cidr with custom address and network (when no ‘/’ separator was found) parser
parse_cidr_full_ignore_hostbits
Parse Cidr with custom address and network (when no ‘/’ separator was found) parser
parse_cidr_ignore_hostbits
Parse Cidr with custom address parser
parse_inet
Parse Inet with custom address parser
parse_inet_full
Parse Inet with custom address and network (when no ‘/’ separator was found) parser
parse_loose_ip
Parse IP address; fall back to inet_addr if normal parser fails
parse_loose_ipv4
Parse IPv4 address; fall back to inet_addr if normal parser fails
parse_short_any_ip_cidr
Parses normal IP CIDR notations, "any" or short IPv4 forms via parse_short_ipv4_address_as_cidr
parse_short_ip_address_as_cidr
Parses normal IP addresses as host addresses, and short IPv4 addresses via parse_short_ipv4_address_as_cidr
parse_short_ip_cidr
Parses normal IP CIDR notations or short IPv4 forms via parse_short_ipv4_address_as_cidr
parse_short_ipv4_address_as_cidr
Parse “short” IPv4 addresses as networks with octet-aligned length
parse_short_ipv4_cidr
Parses normal IPv4 CIDR notations or short forms via parse_short_ipv4_address_as_cidr