use-url 0.0.1

Small URL utility primitives for RustUse
Documentation
  • Coverage
  • 68.42%
    13 out of 19 items documented1 out of 13 items with examples
  • Size
  • Source code size: 11.01 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 373.35 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 15s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Documentation
  • RustUse/use-web
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-url

Small URL utility primitives for RustUse.

Experimental

use-url is experimental while the use-web workspace remains below 0.3.0. Expect small API adjustments during the first release wave.

Example

use use_url::{extract_host, parse_url_basic, remove_query};

let parts = parse_url_basic("https://example.com/docs?page=2#intro").unwrap();

assert_eq!(parts.scheme, "https");
assert_eq!(extract_host("https://example.com/docs?page=2#intro").as_deref(), Some("example.com"));
assert_eq!(remove_query("https://example.com/docs?page=2#intro"), "https://example.com/docs#intro");

Scope

  • Basic URL splitting for scheme, host, port, path, query, and fragment.
  • Lightweight path and suffix helpers.
  • Graceful handling for malformed or partial input.

Non-goals

  • Full WHATWG URL parsing.
  • DNS validation.
  • HTTP client behavior.
  • IDNA handling.

License

Licensed under either of the following, at your option:

  • Apache License, Version 2.0
  • MIT license