1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-24 04:52:58 +01:00

enforce constraint on OpensslAcceptor

This commit is contained in:
Nikolay Kim 2019-03-12 13:57:28 -07:00
parent b3366bc1af
commit f6f292a678

View File

@ -13,12 +13,12 @@ use crate::{Io, Protocol, ServerConfig};
/// Support `SSL` connections via openssl package /// Support `SSL` connections via openssl package
/// ///
/// `ssl` feature enables `OpensslAcceptor` type /// `ssl` feature enables `OpensslAcceptor` type
pub struct OpensslAcceptor<T, P = ()> { pub struct OpensslAcceptor<T: AsyncRead + AsyncWrite, P = ()> {
acceptor: SslAcceptor, acceptor: SslAcceptor,
io: PhantomData<(T, P)>, io: PhantomData<(T, P)>,
} }
impl<T, P> OpensslAcceptor<T, P> { impl<T: AsyncRead + AsyncWrite, P> OpensslAcceptor<T, P> {
/// Create default `OpensslAcceptor` /// Create default `OpensslAcceptor`
pub fn new(acceptor: SslAcceptor) -> Self { pub fn new(acceptor: SslAcceptor) -> Self {
OpensslAcceptor { OpensslAcceptor {