Module url

Source
Expand description

URL parsing and manipulation.


url implements the WHATWG URL Standard for parsing and manipulating URLs. It provides a robust, spec-compliant URL parser that handles all the edge cases of URL parsing, including internationalized domain names, percent encoding, and proper handling of relative URLs.

§Examples

Basic URL parsing and components:

use url::Url;

let parsed = Url::parse("https://example.com:8080/path?query=value#fragment").unwrap();
assert_eq!(parsed.scheme(), "https");
assert_eq!(parsed.host_str(), Some("example.com"));
assert_eq!(parsed.port(), Some(8080));
assert_eq!(parsed.path(), "/path");
assert_eq!(parsed.query(), Some("query=value"));
assert_eq!(parsed.fragment(), Some("fragment"));

Modules§

form_urlencoded
Parser and serializer for the application/x-www-form-urlencoded syntax, as used by HTML forms.

Structs§

OpaqueOrigin
Opaque identifier for URLs that have file or other schemes
ParseOptions
Full configuration for the URL parser.
PathSegmentsMut
Exposes methods to manipulate the path of an URL that is not cannot-be-base.
Url
A parsed URL record.
UrlQuery
Implementation detail of Url::query_pairs_mut. Typically not used directly.

Enums§

Host
The host name of an URL.
Origin
The origin of an URL
ParseError
Errors that can occur during parsing.
Position
Indicates a position within a URL based on its components.
SyntaxViolation
Non-fatal syntax violations that can occur during parsing.

Type Aliases§

EncodingOverride