pub struct AcceptorBuilder<State> { /* private fields */ }Expand description
Build an HttpOrHttpsAcceptor
Defaults to accepting HTTP connections, call the https method to accept HTTPS connections instead
Implementations§
source§impl AcceptorBuilder<Http>
impl AcceptorBuilder<Http>
sourcepub const fn new(listener: TcpListener) -> Self
pub const fn new(listener: TcpListener) -> Self
Create a new builder for an HttpOrHttpsAcceptor
Defaults to accepting HTTP
sourcepub fn https(self, tls_acceptor: TlsAcceptor) -> AcceptorBuilder<Https>
pub fn https(self, tls_acceptor: TlsAcceptor) -> AcceptorBuilder<Https>
Converts the builder into accepting HTTPS using the provided TlsAcceptor
sourcepub fn build(self) -> HttpOrHttpsAcceptor
pub fn build(self) -> HttpOrHttpsAcceptor
Builds an HttpOrHttpsAcceptor to accept HTTP connections
source§impl AcceptorBuilder<Https>
impl AcceptorBuilder<Https>
sourcepub const fn max_handshakes(self, num: usize) -> Self
pub const fn max_handshakes(self, num: usize) -> Self
Set the maximum number of handshakes that will be processed concurrently
Defaults to 64
sourcepub const fn timeout(self, timeout: Duration) -> Self
pub const fn timeout(self, timeout: Duration) -> Self
Set the maximum amount of time that a handshake can take before being aborted. Setting it to 0 will not disable the timeout, but will instead instantly drop every connection.
Defaults to 10 seconds
sourcepub fn build(self) -> HttpOrHttpsAcceptor
pub fn build(self) -> HttpOrHttpsAcceptor
Builds an HttpOrHttpsAcceptor to accept HTTPS connections
Auto Trait Implementations§
impl<State> !Freeze for AcceptorBuilder<State>
impl<State> RefUnwindSafe for AcceptorBuilder<State>where
State: RefUnwindSafe,
impl<State> Send for AcceptorBuilder<State>where
State: Send,
impl<State> Sync for AcceptorBuilder<State>where
State: Sync,
impl<State> Unpin for AcceptorBuilder<State>where
State: Unpin,
impl<State> UnwindSafe for AcceptorBuilder<State>where
State: UnwindSafe,
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