runtime_raw

Trait TcpListener

Source
pub trait TcpListener: Debug + Send {
    // Required methods
    fn local_addr(&self) -> Result<SocketAddr>;
    fn poll_accept(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
    ) -> Poll<Result<Pin<Box<dyn TcpStream>>>>;
}
Expand description

A TcpListener for this Runtime

Required Methods§

Source

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

Get the address the listener is listening on.

Source

fn poll_accept( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<Pin<Box<dyn TcpStream>>>>

Check if the listener is ready to accept connections.

Implementors§