use-port 0.1.0

Port parsing, classification, and service lookup helpers for RustUse.
Documentation
  • Coverage
  • 100%
    15 out of 15 items documented1 out of 11 items with examples
  • Size
  • Source code size: 6.15 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 398.15 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 7s Average build duration of successful builds.
  • all releases: 7s 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-port

use-port provides small helpers for parsing port numbers, classifying port ranges, and mapping a few common services to default ports.

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

Example Usage

use use_port::{common_port_name, parse_port, port_range, PortRange};

let port = parse_port("443").unwrap();

assert_eq!(port.value, 443);
assert_eq!(port_range(port.value), PortRange::System);
assert_eq!(common_port_name(port.value), Some("https"));

Scope

  • Port parsing from strings.
  • Port range classification.
  • Small common service-to-port lookup tables.

Non-goals

  • Port scanning.
  • Socket binding.
  • Service discovery.

License

Licensed under MIT OR Apache-2.0.