kvarn_utils::prelude::uri

Struct Port

pub struct Port<T> { /* private fields */ }
Expand description

The port component of a URI.

Implementations§

§

impl<T> Port<T>

pub fn as_u16(&self) -> u16

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

pub fn as_str(&self) -> &str

Returns the port number as a str.

§Examples

Port as str.