Crate fluent_uri

Crate fluent_uri 

Source
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): Implies alloc and impl-error. Required for Authority::socket_addrs.

  • alloc: Required for memory-allocating types and functions.

  • impl-error: Required for Error implementations. Disabling std while enabling impl-error requires a minimum Rust version of 1.81.

  • net: Required for IP address fields in Host, for Builder::host to take an IP address as argument, and for Authority::socket_addrs. Disabling std while enabling net requires a minimum Rust version of 1.77.

  • serde: Required for Serialize and Deserialize implementations.

Modules§

buildalloc
Module for URI/IRI (reference) building.
component
URI/IRI components.
normalizealloc
Module for normalization.
pct_enc
Percent-encoding utilities.
resolvealloc
Module for reference resolution.

Structs§

Iri
An IRI.
IriRef
An IRI reference, i.e., either a IRI or a relative reference.
ParseError
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§

ConvertError
An error occurred when downcasting a URI/IRI (reference).
ParseErrorKind
Detailed cause of a ParseError.