Struct url::HostAndPort
source · pub struct HostAndPort<S = String> {
pub host: Host<S>,
pub port: u16,
}
Expand description
This mostly exists because coherence rules don’t allow us to implement
ToSocketAddrs for (Host<S>, u16)
.
Fields§
§host: Host<S>
§port: u16
Implementations§
source§impl<'a> HostAndPort<&'a str>
impl<'a> HostAndPort<&'a str>
sourcepub fn to_owned(&self) -> HostAndPort<String>
pub fn to_owned(&self) -> HostAndPort<String>
Return a copy of self
that owns an allocated String
but does not borrow an &Url
.
Trait Implementations§
source§impl<S: Clone> Clone for HostAndPort<S>
impl<S: Clone> Clone for HostAndPort<S>
source§fn clone(&self) -> HostAndPort<S>
fn clone(&self) -> HostAndPort<S>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<S: Debug> Debug for HostAndPort<S>
impl<S: Debug> Debug for HostAndPort<S>
source§impl<S: AsRef<str>> ToSocketAddrs for HostAndPort<S>
impl<S: AsRef<str>> ToSocketAddrs for HostAndPort<S>
§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
SocketAddr
s. Read moreAuto Trait Implementations§
impl<S> RefUnwindSafe for HostAndPort<S>where S: RefUnwindSafe,
impl<S> Send for HostAndPort<S>where S: Send,
impl<S> Sync for HostAndPort<S>where S: Sync,
impl<S> Unpin for HostAndPort<S>where S: Unpin,
impl<S> UnwindSafe for HostAndPort<S>where S: 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