All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- New
SubnetIterator
iterator type for iterating over a network's subnets. - New
Netv6Addr#len() -> Option<u128>
method for computing the number of addresses contained in a network. - New
Netv6Addr#is_empty() -> bool
method for determining whether or not the network is empty. - New
Netv4Addr#len() -> Option<u32>
method for computing the number of addresses contained in a network. - New
Netv4Addr#is_empty() -> bool
method for determining whether or not the network is empty. - New
AddressIterator
iterator type for iterating over a network's addresses.
0.10.0 - 2021-07-06
-
Breaking:
Netv4Addr::addr
,Netv4Addr::mask
,Netv6Addr::addr
, andNetv6Addr::mask
all now returnIpv4Addr
orIpv6Addr
respectively instead of&Ipv4Addr
or&Ipv6Addr
. -
Breaking: Replaced the
derive
'dOrd
impl with our own explicit implementation. If you were using our old ordering, bare in mind that the behavior has changed.Previously, we just used the derived
Ord
comparison on the underlyingIp<...>Addr
structs in field-wise ordering. Now, aNet<...>Addr
struct is considered greater than another if itsaddr
is equal but its mask is greater, or otherwise if itsaddr
is greater. For example,1.0.0.0/8
<2.0.0.0/8
,1.0.0.0/7
<1.0.0.0/8
, etc. -
Internal fixes for the tests
-
Adjusted CI configuration
0.9.0 - 2020-02-26
-
Breaking: Adjusted the signature of the
Contains
trait to take a type parameter.Most users should not be affected in any way by this change, as the
.contains()
method still has the same syntax. However, the types for which containment can be checked are now explicitly enumerated.
0.8.0 - 2020-02-26
is_cidr
method onNetAddr
,Netv4Addr
, andNetv6Addr
to return whether the represented netaddr is CIDR or not.
- Updated the
serde::de
behavior to be slightly more informative and standard.
0.7.1 - 2019-01-12
- Documented a few undocumented types.
0.7.0 - 2019-12-24
- A new
Result<T, Error>
type, which is a sugar around the nascentError
type.
- Renamed the
NetAddrError
type to justError
.
0.6.1 - 2019-11-18
- Added the
serde
feature to thedocs.rs
metadata key
0.6.0 - 2019-11-18
- Implementations for
serde::Serialize
andserde::Deserialize
on core types, gated behind theserde
feature
0.5.0 - 2019-10-20
- Implementation for
core::fmt::Display
on theNetAddr
enum and theNetv4Addr
andNetv6Addr
structs.
0.4.1 - 2019-09-29
- Tests for the
Merge
trait. - Tests for the methods on the
Netv4Addr
andNetv6Addr
structs. - Documentation for some items.
0.4.0 - 2019-08-25
- Made the
mask
andaddr
methodsconst
andpub
under theNetv4Addr
andNetv6Addr
types.
0.3.0 - 2019-08-22
- A lot of tests to the source code in a structured way.
- Breaking: Restructured the API to use lots of modules.
- Breaking: Use the recently-stabilized
Self
type alias in the code. (requires Rust 1.37) - Began using GitHub Actions for CI instead of CircleCI.
- The
script/clippy
script.
0.2.0 - 2019-08-12
- A Travis CI configuration for testing.
- Existing API to use traits.
0.1.2 - 2019-07-23
- SPDX identifier for
Apache-2.0
in the manifest, allowing releases to be published.
0.1.1 - 2019-07-23
- A
CHANGELOG.md
file.
0.1.0 - 2019-07-23
NetAddr
enum with two variants (V4
,V6
), each containing the respectiveIpv\dAddr
class.#[derive]
-ed impls forCopy
,Clone
,Debug
,PartialEq
,Eq
,Ord
, andHash
onNetAddr
.NetAddr#netmask
method to return the netmask address inIpAddr
form.NetAddr#network
method to return the network address inIpAddr
form.NetAddrError
enum to hold structured information aboutNetAddr
-generated errors.#[derive]
-ed impls forClone
,Debug
,PartialEq
,Eq
,PartialOrd
,Ord
, andHash
onNetAddrError
.- An impl for
From<std::net::AddrParseError
onNetAddrError
. - A public
mask<T, U>
function for performing bitwise arithmetic on arbitrary types. - A
F32: u32
constant onNetAddr
. - A
F128: u128
constant onNetAddr
. - A
F32V4: Ipv4Addr
constant onNetAddr
. - A
F32V6: Ipv6Addr
constant onNetAddr
. NetAddr#contains<T>
generic method for checking containment of anything that can be converted to aNetAddr
.NetAddr#broadcast
method for getting the broadcast address of IPv4 networks only.NetAddr#merge
method for combining networks together, if possible.- An impl for
From<std::net::IpAddr>
onNetAddr
which uses netmasks of all ones. - An impl for
From<std::net::Ipv4Addr>
onNetAddr
. - An impl for
From<std::net::Ipv6Addr>
onNetAddr
. - An impl for
FromStr
onNetAddr
for parsing. - An impl for
PartialOrd
onNetAddr
for comparing two networks first by network address and then by netmask. - Tests for all of these Added features.