cidr/parsers/
mod.rs

1//! Extra parsers
2//!
3//! The `FromStr` implementations in this crate are rather strict
4//! about the allowed input.  Depending on the data format that needs
5//! to be handled the functions here might help implementing custom
6//! parsers.
7//!
8//! The parser combinators that take an `address_parser` can either
9//! take `FromStr::from_str` or a non-default parser like [`parse_loose_ip`].
10//! They are used to parse addresses (either as part of a `"/"` separated
11//! notation or as single host).
12//!
13//! Parser combinators that take an additional `host_parser` use that
14//! to parse strings that don't have an `"/"` separator - usually these
15//! should return Cidr/Inet "host" values, but they can allow special
16//! syntax like [`parse_short_ip_cidr`] to represent non-host networks too.
17
18mod combinators;
19mod inetaddr;
20mod ipv4_short;
21
22pub use self::{
23	combinators::{
24		parse_any_cidr,
25		parse_any_cidr_full,
26		parse_any_cidr_full_ignore_hostbits,
27		parse_any_cidr_ignore_hostbits,
28		parse_cidr,
29		parse_cidr_full,
30		parse_cidr_full_ignore_hostbits,
31		parse_cidr_ignore_hostbits,
32		parse_inet,
33		parse_inet_full,
34	},
35	inetaddr::{
36		inet_addr,
37		parse_loose_ip,
38		parse_loose_ipv4,
39	},
40	ipv4_short::{
41		parse_short_any_ip_cidr,
42		parse_short_ip_address_as_cidr,
43		parse_short_ip_cidr,
44		parse_short_ipv4_address_as_cidr,
45		parse_short_ipv4_cidr,
46	},
47};