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

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

The port component of a URI.

Methods

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_part().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_part().unwrap();
assert_eq!(port.as_str(), "80");

Trait Implementations

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

#[must_use]
default fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

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

#[must_use]
default fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

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

#[must_use]
default fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

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

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

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

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

Auto Trait Implementations

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

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

Blanket Implementations

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

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]