pub struct HostPort<H: Borrow<Host>>(pub H, pub u16);Available on crate feature
std or rust_v_1_77 only.Expand description
Helper struct that can be used to correctly display host:port
This is needed because IPv6 addresses need square brackets when displayed as ip:port but
square brackets are not used when they are displayed standalone.
Tuple Fields§
§0: HHost
You can use Host, &Host or other smart pointers here.
1: u16Port
Trait Implementations§
Source§impl<H: Borrow<Host>> ToSocketAddrs for HostPort<H>
Available on crate feature std only.Note that onion addresses can never be resolved, you have to use a proxy instead.
impl<H: Borrow<Host>> ToSocketAddrs for HostPort<H>
Available on crate feature
std only.Note that onion addresses can never be resolved, you have to use a proxy instead.
Source§type Iter = SocketAddrs
type Iter = SocketAddrs
Returned iterator over socket addresses which this type may correspond
to.
Source§fn to_socket_addrs(&self) -> Result<Self::Iter>
fn to_socket_addrs(&self) -> Result<Self::Iter>
Converts this object to an iterator of resolved
SocketAddrs. Read moreAuto Trait Implementations§
impl<H> Freeze for HostPort<H>where
H: Freeze,
impl<H> RefUnwindSafe for HostPort<H>where
H: RefUnwindSafe,
impl<H> Send for HostPort<H>where
H: Send,
impl<H> Sync for HostPort<H>where
H: Sync,
impl<H> Unpin for HostPort<H>where
H: Unpin,
impl<H> UnwindSafe for HostPort<H>where
H: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more