Skip to main content

Socket

Trait Socket 

pub trait Socket: Send + 'static {
    type Read: AsyncRead + Unpin + Send + 'static;
    type Write: TryWrite;

    // Required method
    fn split(self) -> (Self::Read, Self::Write);
}
Expand description

A connection the server can serve: read by the connection task, written by whichever thread produced a reply.

Required Associated Types§

type Read: AsyncRead + Unpin + Send + 'static

type Write: TryWrite

Required Methods§

fn split(self) -> (Self::Read, Self::Write)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl Socket for TcpStream

§

type Read = OwnedReadHalf

§

type Write = OwnedWriteHalf

§

fn split(self) -> (Self::Read, Self::Write)

§

impl Socket for UnixStream

§

type Read = OwnedReadHalf

§

type Write = OwnedWriteHalf

§

fn split(self) -> (Self::Read, Self::Write)

Implementors§