pub trait QuicConfig<S: Server>: Send + 'static {
type Endpoint: QuicEndpoint;
// Required method
fn bind(
self,
addr: SocketAddr,
runtime: S::Runtime,
info: &mut Info,
) -> Option<Result<Self::Endpoint>>;
}Expand description
Configuration for a QUIC endpoint, provided by the user at server setup time.
QUIC library adapters implement this (e.g. trillium_quinn::QuicConfig). The ()
implementation produces no binding (HTTP/3 disabled).
The generic flow is:
- User provides a
QuicConfigviaConfig::with_quic - During server startup,
bindis called with the TCP listener’s address and runtime - The resulting
QuicEndpointis stored onRunningConfigand drives the H3 accept loop
Required Associated Types§
Sourcetype Endpoint: QuicEndpoint
type Endpoint: QuicEndpoint
The bound endpoint type produced by bind.
Required Methods§
Sourcefn bind(
self,
addr: SocketAddr,
runtime: S::Runtime,
info: &mut Info,
) -> Option<Result<Self::Endpoint>>
fn bind( self, addr: SocketAddr, runtime: S::Runtime, info: &mut Info, ) -> Option<Result<Self::Endpoint>>
Bind a QUIC endpoint to the given address.
The runtime is provided so that QUIC library adapters can bridge to the active async runtime for timers, spawning, and UDP I/O.
Returns None if QUIC is not configured (the () case), Some(Ok(binding)) on success,
or Some(Err(..)) if binding fails.