Struct http::uri::Port[][src]

pub struct Port<T> { /* fields omitted */ }

The port component of a URI.

Implementations

impl<T> Port<T>[src]

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

Returns the port number as a u16.

Examples

Port as u16.

let authority: Authority = "example.org:80".parse().unwrap();

let port = authority.port().unwrap();
assert_eq!(port.as_u16(), 80);

impl<T> Port<T> where
    T: AsRef<str>, 
[src]

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

Returns the port number as a str.

Examples

Port as str.

let authority: Authority = "example.org:80".parse().unwrap();

let port = authority.port().unwrap();
assert_eq!(port.as_str(), "80");

Trait Implementations

impl<T> AsRef<str> for Port<T> where
    T: AsRef<str>, 
[src]

impl<T> Debug for Port<T> where
    T: Debug
[src]

impl<T> Display for Port<T>[src]

impl<T, U> PartialEq<Port<U>> for Port<T>[src]

impl<T> PartialEq<u16> for Port<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Port<T> where
    T: RefUnwindSafe

impl<T> Send for Port<T> where
    T: Send

impl<T> Sync for Port<T> where
    T: Sync

impl<T> Unpin for Port<T> where
    T: Unpin

impl<T> UnwindSafe for Port<T> where
    T: UnwindSafe

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> 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.