use-host 0.1.0

Host parsing and normalization helpers for RustUse.
Documentation
  • Coverage
  • 100%
    17 out of 17 items documented1 out of 11 items with examples
  • Size
  • Source code size: 7.2 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 400.57 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 6s Average build duration of successful builds.
  • all releases: 6s 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-host

use-host provides lightweight helpers for parsing hosts such as localhost, IP literals, and domain-style host names.

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

Example Usage

use use_host::{bracket_ipv6_host, parse_host, HostKind};

let host = parse_host("[::1]").unwrap();

assert_eq!(host.kind, HostKind::Ip);
assert_eq!(host.value, "::1");
assert_eq!(bracket_ipv6_host(&host.value), "[::1]");

Scope

  • Localhost, IP-literal, and hostname-style host detection.
  • Simple host normalization and IPv6 bracket helpers.

Non-goals

  • DNS lookup.
  • Public suffix validation.
  • Host reachability testing.

License

Licensed under MIT OR Apache-2.0.