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]
impl Uri
pub fn path(&self) -> &str
[src]
pub fn path(&self) -> &str
Get the path of this Uri
.
pub fn scheme(&self) -> Option<&str>
[src]
pub fn scheme(&self) -> Option<&str>
Get the scheme of this Uri
.
Get the authority of this Uri
.
pub fn host(&self) -> Option<&str>
[src]
pub fn host(&self) -> Option<&str>
Get the host of this Uri
.
pub fn port(&self) -> Option<u16>
[src]
pub fn port(&self) -> Option<u16>
Get the port of this Uri
.
pub fn query(&self) -> Option<&str>
[src]
pub fn query(&self) -> Option<&str>
Get the query string of this Uri
, starting after the ?
.
pub fn is_absolute(&self) -> bool
[src]
pub fn is_absolute(&self) -> bool
Returns whether this URI is in absolute-form
.
An example of absolute form is https://hyper.rs
.
Trait Implementations
impl Clone for Uri
[src]
impl Clone for Uri
fn clone(&self) -> Uri
[src]
fn clone(&self) -> Uri
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Hash for Uri
[src]
impl Hash for Uri
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
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]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl FromStr for Uri
[src]
impl FromStr for Uri
type Err = UriError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Uri, UriError>
[src]
fn from_str(s: &str) -> Result<Uri, UriError>
Parses a string s
to return a value of this type. Read more
impl PartialEq for Uri
[src]
impl PartialEq for Uri
fn eq(&self, other: &Uri) -> bool
[src]
fn eq(&self, other: &Uri) -> bool
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]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialEq<str> for Uri
[src]
impl PartialEq<str> for Uri
fn eq(&self, other: &str) -> bool
[src]
fn eq(&self, other: &str) -> bool
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]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<'a> PartialEq<&'a str> for Uri
[src]
impl<'a> PartialEq<&'a str> for Uri
fn eq(&self, other: &&'a str) -> bool
[src]
fn eq(&self, other: &&'a str) -> bool
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]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<'a> PartialEq<Uri> for &'a str
[src]
impl<'a> PartialEq<Uri> for &'a str
fn eq(&self, other: &Uri) -> bool
[src]
fn eq(&self, other: &Uri) -> bool
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]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Eq for Uri
[src]
impl Eq for Uri
impl AsRef<str> for Uri
[src]
impl AsRef<str> for Uri
impl Default for Uri
[src]
impl Default for Uri
impl Debug for Uri
[src]
impl Debug for Uri
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Display for Uri
[src]
impl Display for Uri