pub trait UnixStream: Sized {
type SocketAddr: UnixSocketAddr;
// Required methods
fn connect<'async_trait, P>(
path: P,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where P: 'async_trait + AsRef<Path> + Send,
Self: 'async_trait;
fn pair() -> Result<(Self, Self)>;
fn peer_addr(&self) -> Result<Self::SocketAddr>;
fn local_addr(&self) -> Result<Self::SocketAddr>;
}Available on Unix only.
Expand description
An async abstraction over std::os::unix::net::UnixStream.
Required Associated Types§
Required Methods§
Sourcefn connect<'async_trait, P>(
path: P,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
fn connect<'async_trait, P>( path: P, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
Connects to the socket to the specified address.
Sourcefn pair() -> Result<(Self, Self)>
fn pair() -> Result<(Self, Self)>
Creates an unnamed pair of connected sockets.
Returns two streams which are connected to each other.
Sourcefn peer_addr(&self) -> Result<Self::SocketAddr>
fn peer_addr(&self) -> Result<Self::SocketAddr>
Returns the socket address of the local half of this connection.
Sourcefn local_addr(&self) -> Result<Self::SocketAddr>
fn local_addr(&self) -> Result<Self::SocketAddr>
Returns the socket address of the remote half of this connection.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl UnixStream for UnixStream
Available on crate feature async-std-rt only.
impl UnixStream for UnixStream
Available on crate feature
async-std-rt only.Source§impl UnixStream for UnixStream
Available on crate feature tokio-rt only.
impl UnixStream for UnixStream
Available on crate feature
tokio-rt only.Implementors§
Source§impl UnixStream for TokioCompat<UnixStream>
Available on crate feature tokio-rt only.
impl UnixStream for TokioCompat<UnixStream>
Available on crate feature
tokio-rt only.