pub struct Parts {
pub url: Url,
pub host: Host<String>,
pub port: u16,
pub addr: SocketAddr,
pub domain: String,
pub path: String,
pub query: String,
pub fragment: String,
}
Expand description
The hierarchical sequence of components of a URI.
Each URI begins with a scheme name that refers to a specification for assigning identifiers within that scheme. As such, the URI syntax is a federated and extensible naming system wherein each scheme’s specification may further restrict the syntax and semantics of identifiers using that scheme. The URI generic syntax is a superset of the syntax of all URI schemes. It was first defined in RFC 2396, published in August 1998, and finalized in RFC 3986, published in January 2005.
Fields§
§url: Url
A Uniform Resource Locator (URL), colloquially termed a web address, is a reference to a web resource that specifies its location on a computer network and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identifier (URI).
host: Host<String>
The registered host name of an URL.
port: u16
The port number of the URL.
addr: SocketAddr
An internet socket address, either IPv4 or IPv6.
domain: String
The domain name (not an IP address) of the given host.
path: String
the path for this URL, as a percent-encoded ASCII string. For cannot-be-a-base URLs, this is an arbitrary string that doesn’t start with ‘/’. For other URLs, this starts with a ‘/’ slash and continues with slash-separated path segments.
query: String
The URL’s query string, if any, as a percent-encoded ASCII string.
fragment: String
A fragment is the part of the URL after the # symbol. The fragment is optional and, if present, contains a fragment identifier that identifies a secondary resource, such as a section heading of a document.
In HTML, the fragment identifier is usually the id attribute of a an element that is scrolled to on load. Browsers typically will not send the fragment portion of a URL to the server.