Modules§
Structs§
Functions§
- convert_
trailing_ space - Encode trailing space as
%20in opaque paths before a setter runs. - domain_
to_ ascii - domain_
to_ unicode - erase_
empty_ host_ path - Per WHATWG URL spec, a non-special URL with an empty host can have its
path erased (WPT
url-setters.any.js). Theurlcrate keeps a trailing/after the authority; reparse the serialization with it stripped when the caller has explicitly set an empty pathname on such a URL. - file_
url_ to_ path - init
- is_
special_ scheme - Returns whether the given scheme is a special scheme.
- normalize_
windows_ drive_ letter - path_
to_ file_ url - preserve_
file_ url_ host - Per WHATWG URL spec §4.5.3 (“URL serializer”), the
/.path sentinel is only inserted when a URL has no host AND its path starts with//. Theurlcrate inserts the sentinel during parsing and can leave it in the serialization even after a host is set, breaking WPTurl-setterssubtests like<non-spec:/.//p>.hostname = 'h'. - restore_
file_ url_ host - When resolving a relative URL against a file:// base whose first path
segment is a Windows drive letter (e.g.
file://h/C:/a/b), the url crate loses the host duringjoin. Per WHATWG URL spec the host must be preserved (WPTurl-constructor.any.js“file://h/C:/a/b” base). Patch the joined URL by restoring the base’s host. - strip_
path_ sentinel - url_
format