pub trait Accept {
type IO: Read + Write + Send + Unpin + 'static;
type AcceptError: Debug;
type Accepting: Future<Output = Result<(Self::IO, Option<SocketAddr>), Self::AcceptError>> + Send + 'static;
// Required method
async fn accept(&mut self) -> Result<Self::Accepting, Error>;
}Required Associated Types§
type IO: Read + Write + Send + Unpin + 'static
type AcceptError: Debug
type Accepting: Future<Output = Result<(Self::IO, Option<SocketAddr>), Self::AcceptError>> + Send + 'static
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl Accept for TcpListener
impl Accept for TcpListener
type IO = TokioIo<TcpStream>
type AcceptError = Infallible
type Accepting = Ready<Result<(<TcpListener as Accept>::IO, Option<SocketAddr>), <TcpListener as Accept>::AcceptError>>
async fn accept(&mut self) -> Result<Self::Accepting, Error>
Source§impl Accept for UnixListener
Available on Unix only.
impl Accept for UnixListener
Available on Unix only.