Trait tls_listener::AsyncAccept
source · pub trait AsyncAccept {
type Connection: AsyncRead + AsyncWrite;
type Address: Debug;
type Error: Error;
// Required method
fn poll_accept(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(Self::Connection, Self::Address), Self::Error>>;
}
Expand description
Asynchronously accept connections.
Required Associated Types§
sourcetype Connection: AsyncRead + AsyncWrite
type Connection: AsyncRead + AsyncWrite
The type of the connection that is accepted.
sourcetype Address: Debug
type Address: Debug
The type of the remote address, such as std::net::SocketAddr
.
If no remote address can be determined (such as for mock connections),
()
or a similar dummy type can be used.
Required Methods§
sourcefn poll_accept(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(Self::Connection, Self::Address), Self::Error>>
fn poll_accept( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Result<(Self::Connection, Self::Address), Self::Error>>
Poll to accept the next connection.
On success return the new connection, and the address of the peer.
Implementations on Foreign Types§
source§impl AsyncAccept for TcpListener
Available on crate feature tokio-net
only.
impl AsyncAccept for TcpListener
Available on crate feature
tokio-net
only.type Connection = TcpStream
type Error = Error
type Address = SocketAddr
fn poll_accept( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Result<(Self::Connection, Self::Address), Self::Error>>
source§impl AsyncAccept for UnixListener
Available on crate feature tokio-net
only.
impl AsyncAccept for UnixListener
Available on crate feature
tokio-net
only.