Skip to main content

AsyncAcceptableExt

Trait AsyncAcceptableExt 

Source
pub trait AsyncAcceptableExt:
    AsyncAcceptable
    + Send
    + Sync {
    // Provided methods
    fn accept(&self) -> impl Future<Output = Result<Self::Stream>> + Send { ... }
    fn accept_with_sockaddr(
        &self,
    ) -> impl Future<Output = Result<(Self::Stream, SocketAddr)>> + Send { ... }
}
Expand description

Extension trait for AsyncAcceptable that provides async methods.

Provided Methods§

Source

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

Accept a connection asynchronously.

Source

fn accept_with_sockaddr( &self, ) -> impl Future<Output = Result<(Self::Stream, SocketAddr)>> + Send

Accept a connection asynchronously, returning the stream and the peer address.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§