Enum kvarn::application::HttpConnection

source ·
pub enum HttpConnection {
    Http1(Arc<Mutex<Encryption>>),
    Http2(Box<Connection<Encryption, Bytes>>),
    Http3(Connection<Connection, Bytes>),
}
Expand description

A single HTTP connection.

See HttpConnection::new on how to make one and HttpConnection::accept on getting a FatRequest.

Variants§

§

Http1(Arc<Mutex<Encryption>>)

An HTTP/1 connection

§

Http2(Box<Connection<Encryption, Bytes>>)

Available on crate feature http2 only.

An HTTP/2 connection

This is boxed because a [h2::server::Connection] takes up over 1000 bytes of memory, and an Arc 8 bytes. It will increase performance on servers with both HTTP/1 and HTTP/2 connections, but slightly hurt exclusively HTTP/2 servers.

We’ll see how we move forward once HTTP/3 support lands.