pub struct QuicConfig(/* private fields */);Expand description
User-facing QUIC configuration backed by quinn.
Constructed with TLS credentials and passed to
Config::with_quic.
The runtime and UDP transport types are inferred from the server.
trillium_tokio::config()
.with_quic(trillium_quinn::QuicConfig::from_single_cert(&cert_pem, &key_pem))
.run(handler);Implementations§
Source§impl QuicConfig
impl QuicConfig
Sourcepub fn from_single_cert(cert_pem: &[u8], key_pem: &[u8]) -> Self
pub fn from_single_cert(cert_pem: &[u8], key_pem: &[u8]) -> Self
Build a QuicConfig from a single PEM-encoded certificate chain and private key.
Automatically configures ALPN for HTTP/3 (h3). For a custom TLS setup, use
from_rustls_server_config.
Sourcepub fn from_rustls_server_config(tls_config: ServerConfig) -> Self
pub fn from_rustls_server_config(tls_config: ServerConfig) -> Self
Construct from a pre-built rustls::ServerConfig.
Use this when you need a custom TLS setup (client authentication, custom crypto
provider, etc.). HTTP/3 ALPN (h3) is added automatically if not already present.
Sourcepub fn from_quinn_server_config(config: ServerConfig) -> Self
pub fn from_quinn_server_config(config: ServerConfig) -> Self
Construct from a pre-built quinn::ServerConfig.
Use this when you also need to customize quinn transport parameters. The caller is
responsible for configuring ALPN protocols (must include h3 to support HTTP/3).
For custom TLS only, prefer from_rustls_server_config.