[−][src]Module http::uri
URI component of request and response lines
This module primarily contains the Uri
type which is a component of all
HTTP requests and also reexports this type at the root of the crate. A URI
is not always a "full URL" in the sense of something you'd type into a web
browser, but HTTP requests may only have paths on servers but may have full
schemes and hostnames on clients.
Examples
use http::Uri; let uri = "/foo/bar?baz".parse::<Uri>().unwrap(); assert_eq!(uri.path(), "/foo/bar"); assert_eq!(uri.query(), Some("baz")); assert_eq!(uri.host(), None); let uri = "https://www.rust-lang.org/install.html".parse::<Uri>().unwrap(); assert_eq!(uri.scheme_str(), Some("https")); assert_eq!(uri.host(), Some("www.rust-lang.org")); assert_eq!(uri.path(), "/install.html");
Structs
Authority | Represents the authority component of a URI. |
Builder | A builder for |
InvalidUri | An error resulting from a failed attempt to construct a URI. |
InvalidUriParts | An error resulting from a failed attempt to construct a URI. |
Parts | The various parts of a URI. |
PathAndQuery | Represents the path component of a URI |
Port | The port component of a URI. |
Scheme | Represents the scheme component of a URI |
Uri | The URI component of a request. |