Trait Acceptor

Source
pub trait Acceptor:
    Clone
    + Sync
    + Send
    + Unpin
    + 'static {
    type Stream<T: Stream>: Stream;
    type Accept<T: Stream>: Future<Output = Result<Self::Stream<T>, Error>> + Unpin;

    // Required method
    fn accept<T: Stream>(&self, stream: T) -> Self::Accept<T>;
}

Required Associated Types§

Source

type Stream<T: Stream>: Stream

Source

type Accept<T: Stream>: Future<Output = Result<Self::Stream<T>, Error>> + Unpin

Required Methods§

Source

fn accept<T: Stream>(&self, stream: T) -> Self::Accept<T>

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 Acceptor for TlsAcceptor

Source§

type Stream<T: Stream> = TlsStream<T>

Source§

type Accept<T: Stream> = Accept<T>

Source§

fn accept<T: Stream>(&self, stream: T) -> Self::Accept<T>

Implementors§

Source§

impl Acceptor for RawAcceptor

Source§

type Stream<T: Stream> = T

Source§

type Accept<T: Stream> = Ready<Result<T, Error>>

Source§

impl<T: Acceptor> Acceptor for MaybeAcceptor<T>

Source§

type Stream<U: Stream> = MaybeStream<<T as Acceptor>::Stream<U>, U>

Source§

type Accept<U: Stream> = MaybeAccept<T, U>