[][src]Struct http_req::uri::Authority

pub struct Authority { /* fields omitted */ }

Authority of Uri

Example

use http_req::uri::Authority;

let auth: Authority = "user:info@foo.com:443".parse().unwrap();
assert_eq!(auth.host(), "foo.com");

Implementations

impl Authority[src]

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

Returns username of this Authority

Example

use http_req::uri::Authority;

let auth: Authority = "user:info@foo.com:443".parse().unwrap();
assert_eq!(auth.username(), Some("user"));

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

Returns password of this Authority

Example

use http_req::uri::Authority;

let auth: Authority = "user:info@foo.com:443".parse().unwrap();
assert_eq!(auth.password(), Some("info"));

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

Returns information about the user

Example

use http_req::uri::Authority;

let auth: Authority = "user:info@foo.com:443".parse().unwrap();
assert_eq!(auth.user_info(), Some("user:info"));

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

Returns host of this Authority

Example

use http_req::uri::Authority;

let auth: Authority = "user:info@foo.com:443".parse().unwrap();
assert_eq!(auth.host(), "foo.com");

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

Returns port of this Authority

Example

use http_req::uri::Authority;

let auth: Authority = "user:info@foo.com:443".parse().unwrap();
assert_eq!(auth.port(), Some(443));

Trait Implementations

impl Clone for Authority[src]

impl Debug for Authority[src]

impl Display for Authority[src]

impl FromStr for Authority[src]

type Err = ParseErr

The associated error which can be returned from parsing.

impl PartialEq<Authority> for Authority[src]

impl StructuralPartialEq for Authority[src]

Auto Trait Implementations

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.