Struct quinn::EndpointConfig
source · pub struct EndpointConfig { /* private fields */ }
Expand description
Global configuration for the endpoint, affecting all connections
Default values should be suitable for most internet applications.
Implementations§
source§impl EndpointConfig
impl EndpointConfig
sourcepub fn new(reset_key: Arc<dyn HmacKey + 'static>) -> EndpointConfig
pub fn new(reset_key: Arc<dyn HmacKey + 'static>) -> EndpointConfig
Create a default config with a particular reset_key
sourcepub fn cid_generator<F>(&mut self, factory: F) -> &mut EndpointConfigwhere
F: Fn() -> Box<dyn ConnectionIdGenerator + 'static, Global> + Send + Sync + 'static,
pub fn cid_generator<F>(&mut self, factory: F) -> &mut EndpointConfigwhere F: Fn() -> Box<dyn ConnectionIdGenerator + 'static, Global> + Send + Sync + 'static,
Supply a custom connection ID generator factory
Called once by each Endpoint
constructed from this configuration to obtain the CID
generator which will be used to generate the CIDs used for incoming packets on all
connections involving that Endpoint
. A custom CID generator allows applications to embed
information in local connection IDs, e.g. to support stateless packet-level load balancers.
EndpointConfig::new()
applies a default random CID generator factory. This functions
accepts any customized CID generator to reset CID generator factory that implements
the ConnectionIdGenerator
trait.
sourcepub fn reset_key(
&mut self,
key: Arc<dyn HmacKey + 'static>
) -> &mut EndpointConfig
pub fn reset_key( &mut self, key: Arc<dyn HmacKey + 'static> ) -> &mut EndpointConfig
Private key used to send authenticated connection resets to peers who were communicating with a previous instance of this endpoint.
sourcepub fn max_udp_payload_size(
&mut self,
value: u16
) -> Result<&mut EndpointConfig, ConfigError>
pub fn max_udp_payload_size( &mut self, value: u16 ) -> Result<&mut EndpointConfig, ConfigError>
Maximum UDP payload size accepted from peers (excluding UDP and IP overhead).
Must be greater or equal than 1200.
Defaults to 65527, which is the maximum permitted UDP payload.
sourcepub fn supported_versions(
&mut self,
supported_versions: Vec<u32, Global>
) -> &mut EndpointConfig
pub fn supported_versions( &mut self, supported_versions: Vec<u32, Global> ) -> &mut EndpointConfig
Override supported QUIC versions
sourcepub fn grease_quic_bit(&mut self, value: bool) -> &mut EndpointConfig
pub fn grease_quic_bit(&mut self, value: bool) -> &mut EndpointConfig
Whether to accept QUIC packets containing any value for the fixed bit
Enabled by default. Helps protect against protocol ossification and makes traffic less identifiable to observers. Disable if helping observers identify this traffic as QUIC is desired.
Trait Implementations§
source§impl Clone for EndpointConfig
impl Clone for EndpointConfig
source§fn clone(&self) -> EndpointConfig
fn clone(&self) -> EndpointConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more