pub struct ClientBuilder { /* private fields */ }Expand description
Construct a WebTransport Client using sensible defaults.
This is optional; advanced users may use Client::new directly.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn with_congestion_control(self, algorithm: CongestionControl) -> Self
pub fn with_congestion_control(self, algorithm: CongestionControl) -> Self
Enable the specified congestion controller.
Sourcepub fn with_transport_config(self, transport: TransportConfig) -> Self
pub fn with_transport_config(self, transport: TransportConfig) -> Self
Replace the QUIC transport configuration.
Use this to configure idle timeouts, receive windows, concurrent stream limits, datagram buffers, and other transport resource limits.
Sourcepub fn with_dns_timeout(self, timeout: Duration) -> Self
pub fn with_dns_timeout(self, timeout: Duration) -> Self
Limit how long DNS resolution may take.
Sourcepub fn with_handshake_timeout(self, timeout: Duration) -> Self
pub fn with_handshake_timeout(self, timeout: Duration) -> Self
Limit the combined QUIC, HTTP/3 SETTINGS, and CONNECT handshake duration.
Sourcepub fn with_system_roots(self) -> Result<Client, ClientError>
pub fn with_system_roots(self) -> Result<Client, ClientError>
Accept certificates from servers chained to known root CAs.
Sourcepub fn with_server_certificates(
self,
certs: Vec<CertificateDer<'_>>,
) -> Result<Client, ClientError>
pub fn with_server_certificates( self, certs: Vec<CertificateDer<'_>>, ) -> Result<Client, ClientError>
Supply certificates for accepted servers instead of using root CAs.
Sourcepub fn with_server_certificate_hashes(
self,
hashes: Vec<Vec<u8>>,
) -> Result<Client, ClientError>
pub fn with_server_certificate_hashes( self, hashes: Vec<Vec<u8>>, ) -> Result<Client, ClientError>
Supply SHA-256 hashes for accepted certificates instead of using root CAs.
Sourcepub fn dangerous(self) -> DangerousClientBuilder
pub fn dangerous(self) -> DangerousClientBuilder
Access dangerous configuration options.
This method returns a builder that provides access to potentially insecure TLS configurations. These options are opt-in and require explicit acknowledgment through the builder pattern, making the security implications clear at the call site.