use-domain 0.1.0

Domain and hostname validation helpers for RustUse.
Documentation
  • Coverage
  • 100%
    12 out of 12 items documented1 out of 10 items with examples
  • Size
  • Source code size: 6.22 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 344.48 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s 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-domain

use-domain provides lightweight helpers for validating, normalizing, and inspecting domain names and hostnames.

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

Example Usage

use use_domain::{normalize_domain, root_domain_guess, split_domain_labels};

assert_eq!(normalize_domain("WWW.Example.com."), Some("www.example.com".to_string()));
assert_eq!(split_domain_labels("api.example.com"), vec!["api", "example", "com"]);
assert_eq!(root_domain_guess("api.example.com"), Some("example.com".to_string()));

Scope

  • Domain and hostname validation.
  • Domain normalization and label splitting.
  • Small inspection helpers such as depth and subdomain checks.

Non-goals

  • Complete public suffix list support.
  • IDNA conversion.
  • DNS lookup.
  • Certificate validation.

License

Licensed under MIT OR Apache-2.0.