{"id":17122655,"url":"https://github.com/rye/rust-netaddr2","last_synced_at":"2025-04-13T05:39:08.277Z","repository":{"id":43493540,"uuid":"194462104","full_name":"rye/rust-netaddr2","owner":"rye","description":"A Rust network address parsing and arithmetic library.","archived":false,"fork":false,"pushed_at":"2022-02-27T19:17:15.000Z","size":560,"stargazers_count":5,"open_issues_count":8,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-26T22:12:49.493Z","etag":null,"topics":["crates","netaddr"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rye.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-30T01:10:49.000Z","updated_at":"2024-01-27T19:01:44.000Z","dependencies_parsed_at":"2022-09-16T18:01:56.621Z","dependency_job_id":null,"html_url":"https://github.com/rye/rust-netaddr2","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rye%2Frust-netaddr2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rye%2Frust-netaddr2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rye%2Frust-netaddr2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rye%2Frust-netaddr2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rye","download_url":"https://codeload.github.com/rye/rust-netaddr2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670506,"owners_count":21142897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crates","netaddr"],"created_at":"2024-10-14T18:23:28.712Z","updated_at":"2025-04-13T05:39:08.175Z","avatar_url":"https://github.com/rye.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rust-netaddr2 (`netaddr2`) \u0026bull; [![Build Status](https://travis-ci.org/rye/rust-netaddr2.svg?branch=master)](https://travis-ci.org/rye/rust-netaddr2) [![codecov](https://codecov.io/gh/rye/rust-netaddr2/branch/master/graph/badge.svg)](https://codecov.io/gh/rye/rust-netaddr2) [![version](https://img.shields.io/crates/v/netaddr2)](https://crates.io/crates/netaddr2) [![downloads](https://img.shields.io/crates/d/netaddr2)](https://crates.io/crates/netaddr2) [![docs.rs](https://docs.rs/netaddr2/badge.svg)](https://docs.rs/netaddr2)\n\nThis crate is meant as a replacement for an existing reimplementation of various \"netaddr\" libraries that other languages have.\nThere does exist another `netaddr` crate, however the author of this crate did not respond when asked about maintainership status.\n\n## What it does\n\n`NetAddr` arose out of a need to mask and subnet IP space in a manner identical to that which routers and network interfaces do.\nIts utility may be most fully realized in the development of tooling for such purposes.\n\n## Usage\n\nThere are a few ways to use this library.\nPerhaps most ergonomical of these is to use the `FromStr` trait:\n\n```rust\nlet net: NetAddr = \"ff02::1/128\".parse().unwrap();\nlet net: Netv4Addr = \"203.0.113.19/29\".parse().unwrap();\n```\n\nYou can do some operations with these parsed structures, like checking address containment:\n\n```rust\nlet net: NetAddr = \"10.10.10.0/24\".parse().unwrap();\nlet addr: IpAddr = \"10.10.10.1\".parse().unwrap();\nassert!(net.contains(\u0026addr));\n```\n\n(More options will be added eventually.)\n\n## Vision\n\nThis crate aims to be as _simple_ and _straightforward_ as possible.\nWe accomplish this by mirroring the structure of the `std::net::Ip.*Addr` data structures.\nMost of the operations on `NetAddr` structs are implemented through the use of _traits_ which are implemented both on the main structures and on the enum that bridges them.\nThese are also implemented, where appropriate, for standard library structures.\n\nThis crate has no dependencies, and will not accept any unless required for `no_std` support.\nThe only part of this crate that uses `std` is the part that bridges with `std::net::IpAddr`, so a potential contribution would be to generalize `std::net::IpAddr` in a `no_std` environment.\n\n## Maintenance Status\n\nThis codebase is still not feature-complete.\nCheck out the issue tracker if you want to contribute, and don't hesistate to ask for something in an Issue.\nThat said, the business logic is tested and should work.\nWe will release version 1.0 when the GitHub milestone has been fully resolved.\n\n## License\n\n\u003e Copyright \u0026copy; 2019\u0026mdash;2022 Kristofer J. Rye\n\nThis software is released under either of:\n\n- The Apache License, Version 2.0, (http://www.apache.org/licenses/LICENSE-2.0) or\n- The MIT License, (http://opensource.org/licenses/MIT)\n\nat your discretion.\nPlease see the license file ([LICENSE.md](LICENSE.md)) for more information.\n\n\n## Acknowledgements\n\nWe would like to thank the developers of the `netaddr` Ruby gem for inspiring the development and ergonomics of this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frye%2Frust-netaddr2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frye%2Frust-netaddr2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frye%2Frust-netaddr2/lists"}