Module uriparse::uri [−][src]
URIs, Relative References, and URI References
See RFC3986.
This module is composed of three primary types URI
, RelativeReference
, and
URIReference
that are all very similar. The first thing to note is that URIs and relative
references are types of URI references. They differ in only one way: URIs have schemes, while
relative references do not.
As a result, choose the type that best fits your use case. If you need absolute URIs, you should
use URI
, but if you want relative references (e.g. "/"
in a GET request) use
RelativeReference
. If you can accept both, then use URIReference
.
Each type also has a corresponding builder type to allow for convenient construction and
modification via the RelativeReference::into_builder
, URI::into_builder
and
URIReference::into_builder
functions.
All three types are immutable, so if you want to change a component such as the path, you need to reconstruct the type via either the builder or by converting it into its parts and back.
Structs
RelativeReference |
A relative reference as defined in [RFC3986, Section 4.1]. |
RelativeReferenceBuilder |
A builder type for [ |
URI |
A Uniform Resource Identifier (URI) as defined in RFC3986. |
URIBuilder |
A builder type for [ |
URIReference |
A URI reference as defined in [RFC3986, Section 4.1]. |
URIReferenceBuilder |
A builder type for [ |
Enums
InvalidRelativeReference |
An error representing an invalid relative reference. |
InvalidURI |
An error representing an invalid URI. |
InvalidURIReference |
An error representing an invalid URI reference. |