PackageTrack
Sign in Get early access

ipnet

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 useful traits that extend `Ipv4Addr` and `Ipv6Addr` with methods for `Add`, `Sub`, `BitAnd`, and `BitOr` operations. The module only uses stable feature so it is guaranteed to compile using the stable toolchain.

2.12.1 536M downloads/mo #188 most downloaded on crates.io krisprice/ipnet

What this package is like to depend on

Last release 21 days ago

02 Aug 2026

Release timing varies

gaps range from 4 weeks to 1.1 years

Some releases are documented

notes for 21 of 68 stable releases

1 version withdrawn

withdrawn after publishing

9 years old

71 releases · first in 2017

2 releases in the last 12 months

see the full history below

Release timeline

71 releases · Aug 2017 to Aug 2026
2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 60 of 71
  1. 2.12.1 02 Aug 2026
    Release notes
    • Fixes bug where Ipv4Subnets(0.0.0.0, u32::MAX-1, 0) and Ipv6Subnets(::, u128::MAX-1, 0) incorrectly included u32::MAX and u128::MAX. See issue #70.
    • Fixes some typos in documentation and error messages
    Open source →
  2. 2.12.0 03 Mar 2026
    Release notes
    • Backwards compatible schemars 1.* support using version specific features#67
    Open source →
  3. 2.11.0 20 Jan 2025
    Release notes
    • Remove nightly features for no_std #58
    Open source →
  4. 2.10.1 03 Oct 2024
    Release notes
    • ipnet-2.10.0 Rust crate has executable permission on source files. #59
    Open source →
  5. 2.10.0 07 Sep 2024
    Release notes
    • Add new_assert implementations #57
    • Remove redundant curly braces so that the example program can compile #53
    Open source →
  6. 2.9.0 22 Oct 2023
    Release notes
    • Add ser_as_str feature to serialize using serialize_str() #52
    Open source →
  7. 2.8.0 26 Jun 2023
    Release notes
    • Add no_std support on nightly #51
    Open source →
  8. 2.7.2 27 Mar 2023
    Release notes
    • Inline constructors and field getters #48
    • Use Serializer::collect_str to serialize output of Display #39
    Open source →
  9. 2.7.1 08 Jan 2023
    Release notes
    • Fix overflow in mask to prefix conversion #47
    Open source →
  10. 2.7.0 11 Dec 2022
    Release notes
    • Allow to invoke some functions as const fn #43
    Open source →
  11. 2.6.0 07 Dec 2022
    Release notes
    • Add IP netmask to prefix conversion functions and new with_netmask() constructors.
    Open source →
  12. 2.5.1 06 Nov 2022

    Nothing published for this version

  13. 2.5.0 16 Apr 2022
    Release notes
    • Manually implement JsonSchema for IpNet, Ipv4Net, Ipv6Net #41 because default derived JsonSchema does not correspond to Serde representation #40
    • Migrate to edition 2018
    Open source →
  14. 2.4.0 06 Mar 2022
    Release notes
    • Add 'schemars' feature for deriving JSON schema #31
    • add convenience IpNet::new method #36
    Open source →
  15. 2.3.1 15 Jun 2021
    Release notes
    • Merge Fix Error::description() deprecation warning #28.
    Open source →
  16. 2.3.0 16 Mar 2020
    Release notes
    • Merge @imp's Default implementation. See #18. Ipv4Net and Ipv6Net now default to 0.0.0.0/0 and ::/0 respectively. IpNet defaults to the 0/0 Ipv4Net.

    • Add #[allow(arithmetic_overflow)] for Ipv4AddrRange::count() and Ipv6AddrRange::count(). Since 1.43.0-nightly it gives a build error but this panic behavior is desired. In future it may be replaced with explicit use of panic!. See #21.

    Open source →
  17. 2.2.0 02 Feb 2020
    Release notes
    • Implement From<IpAddr>, From<Ipv4Addr>, and From<Ipv6Addr> for IpNet, Ipv4Net, and Ipv6Net respectively.
    Open source →
  18. 2.1.0 08 Nov 2019
    Release notes
    • Implement FusedIterator for IpAddrRange, Ipv4AddrRange, Ipv6AddrRange, IpSubnets, Ipv4Subnets, and Ipv6Subnets.

    • Implement DoubleEndedIterator for IpAddrRange, Ipv4AddrRange, Ipv6AddrRange.

    • Implement custom count(), last(), max(), min(), nth(), and size_hint() for IpAddrRange, Ipv4AddrRange, Ipv6AddrRange.

    Open source →
  19. 2.0.1 12 Oct 2019
    Release notes
    • Fix bug where IpAddrRange never ends when start and end are both 0 #11

    • Fix warning about missing 'dyn'

    Open source →
  20. 2.0.0 22 Aug 2018
    Release notes
    • The Emu128 module has been removed. This provided an emulated 128-bit integer for supporting IPv6 addresses. As of Rust 1.26 the built-in 128-bit integers have been marked stable and this library has been updated to use these instead of Emu128.

    • The with-serde feature name shim has been removed. The serde feature should now be used using the bare serde feature name per the Rust API Guidelines.

    • The Deref on Ipv4Net and Ipv6Net has been removed. This dereferenced to the Ipv4Addr and Ipv6Addr contained in the type. To use these methods call them directly on the contained IP address of interest, which may be accessed using the addr() or network() methods.

    • In prior versions it was necessary to use the Contains trait to access the contains() methods. These are now inherited in public methods on the IpNet, Ipv4Net, and Ipv6Net types so are always available.

    • The implementations of IpAdd<u32> and IpSub<u32> for IpAddr have been removed.

    • The implementations of IpAdd<u32> and IpSub<u32> for Ipv6Addr have been removed.

    Open source →
  21. 2.0.0-rc1 27 Jul 2018 pre-release

    Nothing published for this version

  22. 1.2.1 07 Jun 2018
    Release notes
    • Fix to resolve an issue with the optional serde support, where compact binary formats were not properly supported. See issue #10.
    Open source →
  23. 1.2.0 17 Apr 2018
    Release notes
    • The previous release (1.1.0) introduced serde support using the feature name with-serde, but the Rust API Guidelines recommend using serde as the name of the feature. This release changes the feature name from with-serde to serde, but it is backwards compatible for those that already started using the with-serde feature name. The 1.1.0 release was yanked on crates.io to discourage further use of this feature name. See pull request #7.
    Open source →
  24. 1.1.0 13 Apr 2018 withdrawn
    Release notes
    • Adds serde support. See pull request #6.
    Open source →
  25. 1.0.0 03 Oct 2017

    Nothing published for this version

  26. 1.0.0-rc1 02 Oct 2017 pre-release

    Nothing published for this version

  27. 0.28.1 21 Sep 2017

    Nothing published for this version

  28. 0.28.0 21 Sep 2017

    Nothing published for this version

  29. 0.27.0 14 Sep 2017

    Nothing published for this version

  30. 0.26.5 12 Sep 2017

    Nothing published for this version

  31. 0.26.4 04 Sep 2017

    Nothing published for this version

  32. 0.26.3 04 Sep 2017

    Nothing published for this version

  33. 0.26.2 03 Sep 2017

    Nothing published for this version

  34. 0.26.1 02 Sep 2017

    Nothing published for this version

  35. 0.26.0 02 Sep 2017

    Nothing published for this version

  36. 0.25.1 01 Sep 2017

    Nothing published for this version

  37. 0.25.0 01 Sep 2017

    Nothing published for this version

  38. 0.24.3 01 Sep 2017

    Nothing published for this version

  39. 0.24.2 31 Aug 2017

    Nothing published for this version

  40. 0.24.1 31 Aug 2017

    Nothing published for this version

  41. 0.24.0 31 Aug 2017

    Nothing published for this version

  42. 0.23.1 31 Aug 2017

    Nothing published for this version

  43. 0.23.0 28 Aug 2017

    Nothing published for this version

  44. 0.22.0 28 Aug 2017

    Nothing published for this version

  45. 0.21.1 28 Aug 2017

    Nothing published for this version

  46. 0.21.0 28 Aug 2017

    Nothing published for this version

  47. 0.20.1 28 Aug 2017

    Nothing published for this version

  48. 0.20.0 28 Aug 2017

    Nothing published for this version

  49. 0.19.0 23 Aug 2017

    Nothing published for this version

  50. 0.18.3 23 Aug 2017

    Nothing published for this version

  51. 0.18.2 23 Aug 2017

    Nothing published for this version

  52. 0.18.1 23 Aug 2017

    Nothing published for this version

  53. 0.18.0 23 Aug 2017

    Nothing published for this version

  54. 0.17.1 22 Aug 2017

    Nothing published for this version

  55. 0.17.0 22 Aug 2017

    Nothing published for this version

  56. 0.16.2 22 Aug 2017

    Nothing published for this version

  57. 0.16.1 22 Aug 2017

    Nothing published for this version

  58. 0.16.0 20 Aug 2017

    Nothing published for this version

  59. 0.15.3 20 Aug 2017

    Nothing published for this version

  60. 0.15.2 20 Aug 2017

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive