use-cidr 0.1.0

CIDR parsing and prefix validation helpers for RustUse.
Documentation
  • Coverage
  • 100%
    11 out of 11 items documented1 out of 9 items with examples
  • Size
  • Source code size: 5.59 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 339.96 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 4s 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-cidr

use-cidr provides small helpers for parsing CIDR notation and validating prefix lengths.

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

Example Usage

use use_cidr::{format_cidr, parse_cidr};

let block = parse_cidr("192.168.0.0/24").unwrap();

assert_eq!(block.prefix, 24);
assert_eq!(format_cidr(&block), "192.168.0.0/24");

Scope

  • CIDR parsing for IPv4 and IPv6 blocks.
  • Prefix-length validation helpers.

Non-goals

  • Full subnet math.
  • Route table implementation.
  • IP range expansion.
  • Firewall logic.

License

Licensed under MIT OR Apache-2.0.