use-ip 0.1.0

Lightweight IP address parsing and classification helpers for RustUse.
Documentation
  • Coverage
  • 100%
    18 out of 18 items documented1 out of 13 items with examples
  • Size
  • Source code size: 6.3 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 404.26 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 14s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Documentation
  • RustUse/use-net
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-ip

use-ip provides small helpers for parsing, normalizing, and classifying IP address literals.

Experimental: this crate is below 0.3.0 and the API may change.

Example Usage

use use_ip::{detect_ip_kind, is_private_ip, normalize_ip, IpKind};

assert_eq!(detect_ip_kind("192.168.1.20"), IpKind::V4);
assert!(is_private_ip("fd00::1"));
assert_eq!(normalize_ip("2001:0db8::0001"), Some("2001:db8::1".to_string()));

Scope

  • IP address validation and normalization.
  • Basic IP classifications such as loopback, private, link-local, and multicast.

Non-goals

  • Geolocation.
  • Network interface inspection.
  • Packet parsing.

License

Licensed under MIT OR Apache-2.0.