Struct Port
pub struct Port<T> { /* private fields */ }
The port component of a URI.
Implementations
impl<T> Port<T>
const fn as_u16(&self) -> u16Returns the port number as a
u16.Examples
Port as
u16.# use Authority; let authority: Authority = "example.org:80".parse.unwrap; let port = authority.port.unwrap; assert_eq!;
impl<T> Port<T>
where
T: AsRef<str>,
fn as_str(&self) -> &strReturns the port number as a
str.Examples
Port as
str.# use Authority; let authority: Authority = "example.org:80".parse.unwrap; let port = authority.port.unwrap; assert_eq!;
Trait Implementations
impl<T> AsRef<str> for Port<T>
where
T: AsRef<str>,
fn as_ref(&self) -> &str
impl<T> Debug for Port<T>
where
T: Debug,
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<T> Display for Port<T>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<T> PartialEq<u16> for Port<T>
fn eq(&self, other: &u16) -> bool
impl<T, U> PartialEq<Port<U>> for Port<T>
fn eq(&self, other: &Port<U>) -> bool
Auto Trait Implementations
impl<T> Freeze for Port<T>
where
T: Freeze,
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> UnsafeUnpin for Port<T>
where
T: UnsafeUnpin,
impl<T> UnwindSafe for Port<T>
where
T: UnwindSafe,
Blanket Implementations
impl<T> Any for Port<T>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Port<T>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Port<T>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for Port<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToString for Port<T>
where
T: Display + ?Sized,
fn to_string(&self) -> String
impl<T, U> Into<U> for Port<T>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Port<T>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Port<T>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>