Struct http::uri::Port [−][src]
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][−]
T: AsRef<str>,
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][+]
T: AsRef<str>,
impl<T> Debug for Port<T> where
T: Debug,
[src][+]
T: Debug,
impl<T> Display for Port<T>
[src][+]
impl<T> From<Port<T>> for u16
[src][+]
impl<T> PartialEq<Port<T>> for u16
[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,
T: RefUnwindSafe,
impl<T> Send for Port<T> where
T: Send,
T: Send,
impl<T> Sync for Port<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Port<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Port<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src][+]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,