Struct url::HostAndPort
source · [−]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
sourceimpl<'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
sourceimpl<S: Clone> Clone for HostAndPort<S>
impl<S: Clone> Clone for HostAndPort<S>
sourcefn clone(&self) -> HostAndPort<S>
fn clone(&self) -> HostAndPort<S>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<S: Debug> Debug for HostAndPort<S>
impl<S: Debug> Debug for HostAndPort<S>
sourceimpl<S: AsRef<str>> Display for HostAndPort<S>
impl<S: AsRef<str>> Display for HostAndPort<S>
sourceimpl<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. Read more
sourcefn 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 more
Auto 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more