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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
//! Types for IPv4 and IPv6 network addresses.
//!
//! This module provides types and useful methods for working with IPv4
//! and IPv6 network addresses, commonly called IP prefixes. The new
//! [`IpNet`], [`Ipv4Net`], and [`Ipv6Net`] types build on the existing
//! [`IpAddr`], [`Ipv4Addr`], and [`Ipv6Addr`] types already provided in
//! Rust's standard library and align to their design to stay
//! consistent.
//!
//! The module also provides the [`IpSubnets`], [`Ipv4Subnets`], and
//! [`Ipv6Subnets`] types for iterating over the subnets contained in
//! an IP address range. The [`IpAddrRange`], [`Ipv4AddrRange`], and
//! [`Ipv6AddrRange`] types for iterating over IP addresses in a range.
//! And traits that extend `Ipv4Addr` and `Ipv6Addr` with methods for
//! addition, subtraction, bitwise-and, and bitwise-or operations that
//! are missing in Rust's standard library.
//!
//! The module only uses stable features so it is guaranteed to compile
//! using the stable toolchain.
//!
//! # Organization
//!
//! * [`IpNet`] represents an IP network address, either IPv4 or IPv6.
//! * [`Ipv4Net`] and [`Ipv6Net`] are respectively IPv4 and IPv6 network
//! addresses.
//! * [`IpSubnets`], [`Ipv4Subnets`], and [`Ipv6Subnets`] are iterators
//! that generate the smallest set of IP network addresses bound by an
//! IP address range and minimum prefix length. These can be created
//! using their constructors. They are also returned by the
//! [`subnets()`] methods and used within the [`aggregate()`] methods.
//! * [`IpAddrRange`], [`Ipv4AddrRange`], and [`Ipv6AddrRange`] are
//! iterators that generate IP addresses. These can be created using
//! their constructors. They are also returned by the [`hosts()`]
//! methods.
//! * The [`IpAdd`], [`IpSub`], [`IpBitAnd`], [`IpBitOr`] traits extend
//! the [`Ipv4Addr`] and [`Ipv6Addr`] types with methods to perform
//! these operations.
//!
//! [`IpNet`]: enum.IpNet.html
//! [`Ipv4Net`]: struct.Ipv4Net.html
//! [`Ipv6Net`]: struct.Ipv6Net.html
//! [`IpAddr`]: https://doc.rust-lang.org/std/net/enum.IpAddr.html
//! [`Ipv4Addr`]: https://doc.rust-lang.org/std/net/struct.Ipv4Addr.html
//! [`Ipv6Addr`]: https://doc.rust-lang.org/std/net/struct.Ipv6Addr.html
//! [`IpSubnets`]: enum.IpSubnets.html
//! [`Ipv4Subnets`]: struct.Ipv4Subnets.html
//! [`Ipv6Subnets`]: struct.Ipv6Subnets.html
//! [`subnets()`]: enum.IpNet.html#method.subnets
//! [`aggregate()`]: enum.IpNet.html#method.aggregate
//! [`IpAddrRange`]: enum.IpAddrRange.html
//! [`Ipv4AddrRange`]: struct.Ipv4AddrRange.html
//! [`Ipv6AddrRange`]: struct.Ipv6AddrRange.html
//! [`hosts()`]: enum.IpNet.html#method.hosts
//! [`IpAdd`]: trait.IpAdd.html
//! [`IpSub`]: trait.IpSub.html
//! [`IpBitAnd`]: trait.IpBitAnd.html
//! [`IpBitOr`]: trait.IpBitOr.html
//!
//! # Features
//!
//! These flags can be used to extend functionality using third-party
//! dependencies or optional libraries. See the [features] reference
//! for more information.
//!
//! [features]: https://doc.rust-lang.org/cargo/reference/features.html#the-features-section
//!
//! ## "std"
//!
//! Enabled by default. Disabling this feature will mandate the use of the
//! [core] and [alloc] crates where applicable instead of [std].
//!
//! [core]: https://doc.rust-lang.org/core/
//! [alloc]: https://doc.rust-lang.org/alloc/
//! [std]: https://doc.rust-lang.org/std/
//!
//! ## "serde"
//!
//! Uses [`serde`] to implement the `Serialize` and
//! `Deserialize` traits.
//!
//! For human readable formats (e.g. JSON) the `IpNet`, `Ipv4Net`, and
//! `Ipv6Net` types will serialize to their `Display` strings.
//!
//! For compact binary formats (e.g. Bincode) the `Ipv4Net` and
//! `Ipv6Net` types will serialize to a string of 5 and 17 bytes that
//! consist of the network address octects followed by the prefix
//! length. The `IpNet` type will serialize to an Enum with the V4 or V6
//! variant index prepending the above string of 5 or 17 bytes.
//!
//! [`serde`]: https://serde.rs
//!
//! ## "heapless" [^1]
//!
//! Uses [`heapless`] to optimize serialization performance by avoiding
//! dynamic allocations.
//!
//! [`heapless`]: https://docs.rs/heapless/latest/heapless/
//!
//! ## "schemars08"
//!
//! Uses [`schemars@0.8.*`] to implement the `JsonSchema` trait.
//!
//! [`schemars@0.8.*`]: https://docs.rs/schemars/0.8/schemars/
//!
//! ## "schemars1"
//!
//! Uses [`schemars@1.*`] to implement the `JsonSchema` trait.
//!
//! [`schemars@1.*`]: https://docs.rs/schemars/1/schemars/
//!
//! ## Legacy features
//!
//! The following features are set to be removed in the next major
//! release. Use the provided analogs instead.
//!
//! | Name | Analog | Reason for removal |
//! | ------------ | ------------------------ | --------------------------------------------------------------- |
//! | `json` [^1] | `schemars08` and `serde` | Unconventional naming. |
//! | `ser_as_str` | `heapless` [^1] | Doesn't enable the `serde` feature but does nothing on its own. |
//! | `schemars` | `schemars08` | Replaced by `schemars08`. |
//!
//! [^1]: Enabling these features will also enable the `serde` feature.
//!
extern crate std;
extern crate alloc;
extern crate schemars08;
extern crate schemars1;
extern crate serde;
pub use ;
pub use ;
pub use ;
pub use AddrParseError;