[][src]Struct hyper::Uri

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.

pub fn authority(&self) -> Option<&str>[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 AsRef<str> for Uri[src]

impl Clone for Uri[src]

impl Debug for Uri[src]

impl Default for Uri[src]

impl Display for Uri[src]

impl Eq for Uri[src]

impl FromStr for Uri[src]

type Err = UriError

The associated error which can be returned from parsing.

impl Hash for Uri[src]

impl<'a> PartialEq<&'a str> for Uri[src]

impl PartialEq<Uri> for Uri[src]

impl<'a> PartialEq<Uri> for &'a str[src]

impl PartialEq<str> for Uri[src]

Auto Trait Implementations

impl RefUnwindSafe for Uri

impl Send for Uri

impl Sync for Uri

impl Unpin for Uri

impl UnwindSafe for Uri

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.