pub struct HttpOrHttpsAcceptor(/* private fields */);Expand description
Choose to accept either a HTTP or HTTPS connection
Created by calling the build method on an AcceptorBuilder
Implementations§
source§impl HttpOrHttpsAcceptor
impl HttpOrHttpsAcceptor
sourcepub async fn serve<S>(&mut self, service: S)
pub async fn serve<S>(&mut self, service: S)
Accepts every connection using the service provided, never completes.
Ignores any connection errors produced by the accept method.
sourcepub async fn accept<S>(
&mut self,
service: S
) -> Result<SocketAddr, AcceptorError>
pub async fn accept<S>( &mut self, service: S ) -> Result<SocketAddr, AcceptorError>
Accepts a singular connection and spawns it onto the tokio runtime. Returns the address of the connected client.
§Errors
If the TCP connection or TLS handshake (HTTPS only) fails
Auto Trait Implementations§
impl !Freeze for HttpOrHttpsAcceptor
impl !RefUnwindSafe for HttpOrHttpsAcceptor
impl Send for HttpOrHttpsAcceptor
impl Sync for HttpOrHttpsAcceptor
impl Unpin for HttpOrHttpsAcceptor
impl !UnwindSafe for HttpOrHttpsAcceptor
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