[][src]Trait runtime_raw::TcpStream

pub trait TcpStream: AsyncRead + AsyncWrite + Debug + Send {
    fn poll_write_ready(
        self: Pin<&mut Self>,
        cx: &mut Context
    ) -> Poll<Result<()>>;
fn poll_read_ready(
        self: Pin<&mut Self>,
        cx: &mut Context
    ) -> Poll<Result<()>>;
fn take_error(&self) -> Result<Option<Error>>;
fn local_addr(&self) -> Result<SocketAddr>;
fn peer_addr(&self) -> Result<SocketAddr>;
fn shutdown(&self, how: Shutdown) -> Result<()>;
fn as_raw_fd(&self) -> RawFd; }

A TcpStream for this Runtime

Required methods

fn poll_write_ready(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<()>>

Check if the stream can be written to.

fn poll_read_ready(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<()>>

Check if the stream can be read from.

fn take_error(&self) -> Result<Option<Error>>

Check if any socket errors exist on the TcpStream.

Checking for socket errors is fallible, which is why the outer type is Result.

fn local_addr(&self) -> Result<SocketAddr>

Returns the local address that this stream is connected to.

fn peer_addr(&self) -> Result<SocketAddr>

Returns the remote address that this stream is connected to.

fn shutdown(&self, how: Shutdown) -> Result<()>

Shuts down the read, write, or both halves of this connection.

fn as_raw_fd(&self) -> RawFd

Extracts the raw file descriptor.

Loading content...

Implementors

Loading content...