Skip to main content

Accept

Trait Accept 

Source
pub trait Accept {
    // Required method
    fn accept(&self) -> impl Future<Output = Result<TcpStream>> + Send;

    // Provided method
    fn local(&self) -> Option<SocketAddr> { ... }
}
Expand description

Where connections come from: a bound socket, or in a test one that fails first.

Required Methods§

Source

fn accept(&self) -> impl Future<Output = Result<TcpStream>> + Send

The next connection, or why none could be taken.

Provided Methods§

Source

fn local(&self) -> Option<SocketAddr>

The address the connections come to, for the log, when it is known.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Accept for TcpListener

Implementors§