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§
- Parse “loose” IPv4 address similar to POSIX
inet_addr
- Parse
AnyIpCidr
with custom address parser - Parse
AnyIpCidr
with custom address and network (when no ‘/’ separator was found) parser - Parse
AnyIpCidr
with custom address and network (when no ‘/’ separator was found) parser - Parse
AnyIpCidr
with custom address parser - Parse
Cidr
with custom address parser - Parse
Cidr
with custom address and network (when no ‘/’ separator was found) parser - Parse
Cidr
with custom address and network (when no ‘/’ separator was found) parser - Parse
Cidr
with custom address parser - Parse
Inet
with custom address parser - Parse
Inet
with custom address and network (when no ‘/’ separator was found) parser - Parse IP address; fall back to
inet_addr
if normal parser fails - Parse IPv4 address; fall back to
inet_addr
if normal parser fails - Parses normal IP CIDR notations,
"any"
or short IPv4 forms viaparse_short_ipv4_address_as_cidr
- Parses normal IP addresses as host addresses, and short IPv4 addresses via
parse_short_ipv4_address_as_cidr
- Parses normal IP CIDR notations or short IPv4 forms via
parse_short_ipv4_address_as_cidr
- Parse “short” IPv4 addresses as networks with octet-aligned length
- Parses normal IPv4 CIDR notations or short forms via
parse_short_ipv4_address_as_cidr