Skip to main content

QuicConfig

Trait QuicConfig 

Source
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:

  1. User provides a QuicConfig via Config::with_quic
  2. During server startup, bind is called with the TCP listener’s address and runtime
  3. The resulting QuicEndpoint is stored on RunningConfig and drives the H3 accept loop

Required Associated Types§

Source

type Endpoint: QuicEndpoint

The bound endpoint type produced by bind.

Required Methods§

Source

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.

Implementations on Foreign Types§

Source§

impl<S: Server> QuicConfig<S> for ()

Source§

type Endpoint = ()

Source§

fn bind(self, _: SocketAddr, _: S::Runtime, _: &mut Info) -> Option<Result<()>>

Implementors§