pub enum ResolvedTarget {
SocketAddr(SocketAddr),
UnixSocketAddr(SocketAddr),
}Expand description
The resolved target of a connection attempt.
Variants§
SocketAddr(SocketAddr)
UnixSocketAddr(SocketAddr)
Implementations§
Source§impl ResolvedTarget
impl ResolvedTarget
pub fn tcp(&self) -> Option<SocketAddr>
Source§impl ResolvedTarget
impl ResolvedTarget
Sourcepub async fn connect(&self) -> Result<TokioStream>
pub async fn connect(&self) -> Result<TokioStream>
Connects to the socket address and returns a [TokioStream].
pub async fn listen( &self, ) -> Result<impl Stream<Item = Result<(TokioStream, ResolvedTarget)>> + LocalAddress>
Trait Implementations§
Source§impl Clone for ResolvedTarget
impl Clone for ResolvedTarget
Source§fn clone(&self) -> ResolvedTarget
fn clone(&self) -> ResolvedTarget
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 Debug for ResolvedTarget
impl Debug for ResolvedTarget
Source§impl From<SocketAddr> for ResolvedTarget
impl From<SocketAddr> for ResolvedTarget
Source§fn from(value: SocketAddr) -> Self
fn from(value: SocketAddr) -> Self
Converts to this type from the input type.
Source§impl From<SocketAddr> for ResolvedTarget
impl From<SocketAddr> for ResolvedTarget
Source§fn from(value: SocketAddr) -> Self
fn from(value: SocketAddr) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ResolvedTarget
impl RefUnwindSafe for ResolvedTarget
impl Send for ResolvedTarget
impl Sync for ResolvedTarget
impl Unpin for ResolvedTarget
impl UnwindSafe for ResolvedTarget
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