Skip to main content

Acceptor

Trait Acceptor 

Source
pub trait Acceptor<Input>:
    Clone
    + Send
    + Sync
    + 'static
where Input: Transport,
{ type Output: Transport; type Error: Debug + Send + Sync; // Required method fn accept( &self, input: Input, ) -> impl Future<Output = Result<Self::Output, Self::Error>> + Send; // Provided method fn is_secure(&self) -> bool { ... } }
Expand description

This trait provides the common interface for server-side tls acceptors, abstracting over various implementations

The only implementation provided by this crate is (), which is a noop acceptor, and passes through the Input type.

Required Associated Types§

Source

type Output: Transport

The stream type. For example, TlsStream<Input>

Source

type Error: Debug + Send + Sync

An error type that Acceptor::accept may return

Required Methods§

Source

fn accept( &self, input: Input, ) -> impl Future<Output = Result<Self::Output, Self::Error>> + Send

Transform an Input (AsyncRead + AsyncWrite + Send + Sync + Unpin + 'static) into Self::Output

Provided Methods§

Source

fn is_secure(&self) -> bool

should conns be treated as secure?

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<Input> Acceptor<Input> for ()
where Input: Transport,

Source§

type Error = Infallible

Source§

type Output = Input

Source§

async fn accept(&self, input: Input) -> Result<Self::Output, Self::Error>

Source§

fn is_secure(&self) -> bool

Implementors§