[][src]Struct http_req::uri::Uri

pub struct Uri { /* fields omitted */ }

Representation of Uniform Resource Identifier

Example

use http_req::uri::Uri;

let uri: Uri = "https://user:info@foo.com:12/bar/baz?query#fragment".parse().unwrap();
assert_eq!(uri.host(), Some("foo.com"));

Methods

impl Uri[src]

pub fn scheme(&self) -> &str[src]

Returns scheme of this Uri.

pub fn user_info(&self) -> Option<String>[src]

Returns information about the user included in this Uri.

pub fn host(&self) -> Option<&str>[src]

Returns host of this Uri.

pub fn port(&self) -> &Option<u16>[src]

Returns port of this Uri

pub fn corr_port(&self) -> u16[src]

Returns port corresponding to this Uri. Returns default port if it hasn't been set in the uri.

pub fn path(&self) -> Option<&str>[src]

Returns path of this Uri.

pub fn query(&self) -> Option<&str>[src]

Returns query of this Uri.

pub fn fragment(&self) -> Option<&str>[src]

Returns fragment of this Uri.

pub fn resource(&self) -> String[src]

Returns resource Uri points to.

Trait Implementations

impl PartialEq<Uri> for Uri[src]

impl Clone for Uri[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Display for Uri[src]

impl Debug for Uri[src]

impl FromStr for Uri[src]

type Err = Error

The associated error which can be returned from parsing.

Auto Trait Implementations

impl Send for Uri

impl Sync for Uri

Blanket Implementations

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

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

type Owned = T

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

The type returned in the event of a conversion error.

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