pub struct HyperHttpOrHttpsAcceptor { /* private fields */ }Expand description
Choose to accept either a HTTP or HTTPS connection
Implementations§
source§impl HyperHttpOrHttpsAcceptor
impl HyperHttpOrHttpsAcceptor
sourcepub const fn new_http(listener: TcpListener) -> Self
pub const fn new_http(listener: TcpListener) -> Self
Create an acceptor that will accept HTTP connections
sourcepub fn new_https(
listener: TcpListener,
tls_acceptor: TlsAcceptor,
handshake_timeout: Duration
) -> Self
pub fn new_https( listener: TcpListener, tls_acceptor: TlsAcceptor, handshake_timeout: Duration ) -> Self
Create an acceptor that will accept HTTPS connections using the provided TlsAcceptor
handshake_timeout is the length of time that should be allowed to finish a TLS handshake before we drop the connection.
Setting it to 0 will not disable the timeout, but will instead instantly drop every connection (you probably don’t want this).
Trait Implementations§
source§impl Accept for HyperHttpOrHttpsAcceptor
impl Accept for HyperHttpOrHttpsAcceptor
§type Conn = HttpOrHttpsConnection
type Conn = HttpOrHttpsConnection
The connection type that can be accepted.
§type Error = AcceptorError
type Error = AcceptorError
The error type that can occur when accepting a connection.
Auto Trait Implementations§
impl !RefUnwindSafe for HyperHttpOrHttpsAcceptor
impl Send for HyperHttpOrHttpsAcceptor
impl !Sync for HyperHttpOrHttpsAcceptor
impl Unpin for HyperHttpOrHttpsAcceptor
impl !UnwindSafe for HyperHttpOrHttpsAcceptor
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more