Skip to main content

Accept

Trait Accept 

Source
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§

Source

type IO: Read + Write + Send + Unpin + 'static

Source

type AcceptError: Debug

Source

type Accepting: Future<Output = Result<(Self::IO, Option<SocketAddr>), Self::AcceptError>> + Send + 'static

Required Methods§

Source

async fn accept(&mut self) -> Result<Self::Accepting, Error>

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

Source§

impl Accept for UnixListener

Available on Unix only.

Implementors§