1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
//! This library provides types to represent an IP network ([`Cidr`]) or
//! an IP host withing a network ([`Inet`])
//!
//! The naming follows the names of the [PostgreSQL data types](https://www.postgresql.org/docs/current/static/datatype-net-types.html)
//!
//! By default address parsing is done using `FromStr` from the standard
//! library, which is rather strict in the inputs it accepts.
//! [`Cidr`] types don't accept addresses with host-bits set (i.e. `127.0.0.1/8`
//! isn't valid; it should be `127.0.0.0/8`).
//!
//! Custom parsing can be implemented using the helpers in the [`parsers`] module.
//!
//! If the `#` flag is used with the `Display` formatting (i.e. `{:#}`) the
//! prefix length will be shown even for host addresses (added in `0.1.1`).
//!
//! # Feature `no_unsafe`
//!
//! Enables `#![forbid(unsafe_code)]` for the whole crate; needs to use
//! some workarounds that are likely slower than their `unsafe` variants.
//!
//! # Feature `std`
//!
//! Enabled by default, currently unused.
//!
//! # Feature `serde`
//!
//! This feature enables various types to be serialized using `serde`
//! (without `serde-derive`).
//!
//! In human readable formats the `Display` and `FromStr` interfaces are
//! used. Otherwise all values are serialized in the same format (apart
//! from the newtype wrapping) as a tuple of two values:
//!
//! - `tag: u8`:
//! - `0x00...0x20`: IPv4 with network length `tag`
//! - `0x40...0xc0`: IPv6 with network length `tag - 0x40`
//! - `0xff`: `any`
//! - address according to `tag`: [`Ipv4Addr`] (`[u8; 4]`), [`Ipv6Addr`]
//! (`[u8; 16]`) or `()`
//!
//! The represenation hasn't been changed in 0.2; it is compatible with 0.1.
//!
//! # Feature `bitstring`
//!
//! This feature allows various types to be used as [`bitstring::BitString`],
//! which allows them being in used in containers like [bitstring-trees].
//!
//! [bitstring-trees]: https://crates.io/crates/bitstring-trees
//!
//! [`Ipv4Addr`]: core::net::Ipv4Addr
//! [`Ipv6Addr`]: core::net::Ipv6Addr
pub use ;