pub struct ServerConfigBuilder { /* private fields */ }Expand description
A builder for a ServerConfig.
Implementations§
Source§impl ServerConfigBuilder
impl ServerConfigBuilder
Sourcepub fn build(self) -> ServerConfig
pub fn build(self) -> ServerConfig
Build a ServerConfig from a ServerConfigBuilder.
Sourcepub fn set_transport_config(self, transport: QuicTransportConfig) -> Self
pub fn set_transport_config(self, transport: QuicTransportConfig) -> Self
Sets a custom QuicTransportConfig.
Sourcepub fn set_validation_token_config(
self,
validation_token: ValidationTokenConfig,
) -> Self
pub fn set_validation_token_config( self, validation_token: ValidationTokenConfig, ) -> Self
Sets a custom ValidationTokenConfig.
Sourcepub fn set_token_key(self, value: Arc<dyn HandshakeTokenKey>) -> Self
pub fn set_token_key(self, value: Arc<dyn HandshakeTokenKey>) -> Self
Private key used to authenticate data included in handshake tokens
Sourcepub fn set_retry_token_lifetime(self, value: Duration) -> Self
pub fn set_retry_token_lifetime(self, value: Duration) -> Self
Duration after a retry token was issued for which it’s considered valid
Defaults to 15 seconds.
Sourcepub fn set_max_incoming(self, max_incoming: usize) -> Self
pub fn set_max_incoming(self, max_incoming: usize) -> Self
Maximum number of Incoming to allow to exist at a time.
An Incoming comes into existence when an incoming connection attempt
is received and stops existing when the application either accepts it or otherwise disposes
of it. While this limit is reached, new incoming connection attempts are immediately
refused. Larger values have greater worst-case memory consumption, but accommodate greater
application latency in handling incoming connection attempts.
The default value is set to 65536. With a typical Ethernet MTU of 1500 bytes, this limits memory consumption from this to under 100 MiB–a generous amount that still prevents memory exhaustion in most contexts.
Sourcepub fn set_incoming_buffer_size(self, incoming_buffer_size: u64) -> Self
pub fn set_incoming_buffer_size(self, incoming_buffer_size: u64) -> Self
Maximum number of received bytes to buffer for each Incoming.
An Incoming comes into existence when an incoming connection attempt
is received and stops existing when the application either accepts it or otherwise disposes
of it. This limit governs only packets received within that period, and does not include
the first packet. Packets received in excess of this limit are dropped, which may cause
0-RTT or handshake data to have to be retransmitted.
The default value is set to 10 MiB–an amount such that in most situations a client would
not transmit that much 0-RTT data faster than the server handles the corresponding
Incoming.
Sourcepub fn set_incoming_buffer_size_total(
self,
incoming_buffer_size_total: u64,
) -> Self
pub fn set_incoming_buffer_size_total( self, incoming_buffer_size_total: u64, ) -> Self
Maximum number of received bytes to buffer for all Incoming
collectively.
An Incoming comes into existence when an incoming connection attempt
is received and stops existing when the application either accepts it or otherwise disposes
of it. This limit governs only packets received within that period, and does not include
the first packet. Packets received in excess of this limit are dropped, which may cause
0-RTT or handshake data to have to be retransmitted.
The default value is set to 100 MiB–a generous amount that still prevents memory exhaustion in most contexts.
Sourcepub fn set_time_source(self, time_source: Arc<dyn TimeSource>) -> Self
pub fn set_time_source(self, time_source: Arc<dyn TimeSource>) -> Self
Object to get current SystemTime.
This exists to allow system time to be mocked in tests, or wherever else desired.
Defaults to noq::StdSystemTime, which simply calls SystemTime::now().
Trait Implementations§
Source§impl Clone for ServerConfigBuilder
impl Clone for ServerConfigBuilder
Source§fn clone(&self) -> ServerConfigBuilder
fn clone(&self) -> ServerConfigBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more