async-tls-acceptor

Crates.ioasync-tls-acceptor
lib.rsasync-tls-acceptor
version0.1.0
sourcesrc
created_at2021-04-30 21:18:50.561041
updated_at2021-04-30 21:18:50.561041
descriptiona trait for tls acceptors
homepage
repositoryhttps://github.com/trillium-rs/async-tls-acceptor
max_upload_size
id391716
size15,649
Jacob Rothstein (jbr)

documentation

README

async-tls-acceptor

This crate provides a 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.

Implementing this trait looks like:

use async_tls_acceptor::{async_trait, Acceptor, AsyncRead, AsyncWrite};

#[async_trait]
impl<Input> Acceptor<Input> for my_tls_impl::Acceptor
where
    Input: AsyncRead + AsyncWrite + Send + Sync + Unpin + 'static,
{
    type Output = my_tls_impl::TlsStream<Input>;
    type Error = my_tls_impl::Error;
    async fn accept(&self, input: Input) -> Result<Self::Output, Self::Error> {
        self.accept(input).await
    }
}

Safety

This crate uses #![deny(unsafe_code)].

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Commit count: 8

cargo fmt