Struct hyper::Uri
[−]
[src]
pub struct Uri { /* fields omitted */ }
The Request-URI of a Request's StartLine.
From Section 5.3, Request Target:
Once an inbound connection is obtained, the client sends an HTTP request message (Section 3) with a request-target derived from the target URI. There are four distinct formats for the request-target, depending on both the method being requested and whether the request is to a proxy.
request-target = origin-form / absolute-form / authority-form / asterisk-form
Uri explanations
abc://username:password@example.com:123/path/data?key=value&key2=value2#fragid1
|-| |-------------------------------||--------| |-------------------| |-----|
| | | | |
scheme authority path query fragment
Methods
impl Uri
[src]
pub fn path(&self) -> &str
[src]
Get the path of this Uri
.
pub fn scheme(&self) -> Option<&str>
[src]
Get the scheme of this Uri
.
[src]
Get the authority of this Uri
.
pub fn host(&self) -> Option<&str>
[src]
Get the host of this Uri
.
pub fn port(&self) -> Option<u16>
[src]
Get the port of this Uri
.
pub fn query(&self) -> Option<&str>
[src]
Get the query string of this Uri
, starting after the ?
.
pub fn is_absolute(&self) -> bool
[src]
Returns whether this URI is in absolute-form
.
An example of absolute form is https://hyper.rs
.
Trait Implementations
impl Clone for Uri
[src]
fn clone(&self) -> Uri
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Hash for Uri
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl FromStr for Uri
[src]
type Err = UriError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Uri, UriError>
[src]
Parses a string s
to return a value of this type. Read more
impl PartialEq for Uri
[src]
fn eq(&self, other: &Uri) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a> PartialEq<&'a str> for Uri
[src]
fn eq(&self, other: &&'a str) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.