Trait salvo_core::http::HttpConnection

source ·
pub trait HttpConnection {
    // Required methods
    fn serve(
        self,
        handler: HyperHandler,
        builder: Arc<HttpBuilder>,
        graceful_stop_token: CancellationToken
    ) -> impl Future<Output = IoResult<()>> + Send;
    fn fusewire(&self) -> Option<Arc<dyn Fusewire + Sync + Send + 'static>>;
}
Expand description

A helper trait for http connection.

Required Methods§

source

fn serve( self, handler: HyperHandler, builder: Arc<HttpBuilder>, graceful_stop_token: CancellationToken ) -> impl Future<Output = IoResult<()>> + Send

Serve this http connection.

source

fn fusewire(&self) -> Option<Arc<dyn Fusewire + Sync + Send + 'static>>

Get the fusewire of this connection.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl HttpConnection for H3Connection

Available on crate feature quinn only.
source§

impl<C> HttpConnection for StraightStream<C>
where C: AsyncRead + AsyncWrite + Unpin + Send + 'static,

source§

impl<S> HttpConnection for HandshakeStream<S>
where S: AsyncRead + AsyncWrite + Send + Unpin + 'static,

Available on crate features native-tls or rustls or openssl or acme only.