Expand description
A generic URI/IRI handling library compliant with RFC 3986 and RFC 3987.
Examples: Parsing. Building. Reference resolution. Normalization. Percent-decoding. Percent-encoding.
§Terminology
A URI reference is either a URI or a relative reference. If it starts with a scheme
(like http, ftp, mailto, etc.) followed by a colon (:), it is a URI. For example,
http://example.com/ and mailto:user@example.com are URIs. Otherwise, it is
a relative reference. For example, //example.org/, /index.html, ../, foo,
?bar, and #baz are relative references.
An IRI (reference) is an internationalized version of URI (reference) which may contain non-ASCII characters.
§Guidance for crate users
Advice for designers of new URI schemes can be found in RFC 7595. Guidance on the specification of URI substructure in standards can be found in RFC 8820. The crate author recommends RFC 9413 for further reading as the long-term interoperability of URI schemes may be of concern.
§Crate features
-
std(default): Impliesallocandimpl-error. Required forAuthority::socket_addrs. -
alloc: Required for memory-allocating types and functions. -
impl-error: Required forErrorimplementations. Disablingstdwhile enablingimpl-errorrequires a minimum Rust version of 1.81. -
net: Required for IP address fields inHost, forBuilder::hostto take an IP address as argument, and forAuthority::socket_addrs. Disablingstdwhile enablingnetrequires a minimum Rust version of 1.77. -
serde: Required forSerializeandDeserializeimplementations.
Modules§
- build
alloc - Module for URI/IRI (reference) building.
- component
- URI/IRI components.
- normalize
alloc - Module for normalization.
- pct_enc
- Percent-encoding utilities.
- resolve
alloc - Module for reference resolution.
Structs§
- Iri
- An IRI.
- IriRef
- An IRI reference, i.e., either a IRI or a relative reference.
- Parse
Error - An error occurred when parsing a URI/IRI (reference).
- Uri
- A URI.
- UriRef
- A URI reference, i.e., either a URI or a relative reference.
Enums§
- Convert
Error - An error occurred when downcasting a URI/IRI (reference).
- Parse
Error Kind - Detailed cause of a
ParseError.