Crate normalize_url_rs

Source
Expand description

normalize-url-rs is a port of Node.js normalize-url package for the Rust programming language.

§Sample usage

use normalize_url_rs::{normalize_url, OptionsBuilder};

let options = OptionsBuilder::default().build().unwrap();
let result = normalize_url("https://www.rust-lang.org/", &options);

assert_eq!(result.unwrap(), "https://rust-lang.org")

§Known differences vs original Node.js library

  • Custom protocols are not supported
  • Data URLs are not supported

Structs§

Options
Normalization options.
OptionsBuilder
Builder for Options.

Enums§

NormalizeUrlError
Errors that can occur during normalization.
OptionsBuilderError
Error type for OptionsBuilder
RemoveDirectoryIndexOptions
Controls whether directory index will be removed.
RemoveQueryParametersOptions
Controls whether query parameters will be removed.

Functions§

normalize_url