Struct quinn_proto::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
sourceimpl EndpointConfig
impl EndpointConfig
sourcepub fn new(reset_key: Arc<dyn HmacKey>) -> Self
pub fn new(reset_key: Arc<dyn HmacKey>) -> Self
Create a default config with a particular reset_key
sourcepub fn cid_generator<F: Fn() -> Box<dyn ConnectionIdGenerator> + Send + Sync + 'static>(
&mut self,
factory: F
) -> &mut Self
pub fn cid_generator<F: Fn() -> Box<dyn ConnectionIdGenerator> + Send + Sync + 'static>(
&mut self,
factory: F
) -> &mut Self
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>) -> &mut Self
pub fn reset_key(&mut self, key: Arc<dyn HmacKey>) -> &mut Self
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: u64
) -> Result<&mut Self, ConfigError>
pub fn max_udp_payload_size(
&mut self,
value: u64
) -> Result<&mut Self, ConfigError>
Maximum UDP payload size accepted from peers. Excludes UDP and IP overhead.
The default is suitable for typical internet applications. Applications which expect to run on networks supporting Ethernet jumbo frames or similar should set this appropriately.
sourcepub fn supported_versions(&mut self, supported_versions: Vec<u32>) -> &mut Self
pub fn supported_versions(&mut self, supported_versions: Vec<u32>) -> &mut Self
Override supported QUIC versions
Trait Implementations
sourceimpl Clone for EndpointConfig
impl Clone for EndpointConfig
sourcefn clone(&self) -> EndpointConfig
fn clone(&self) -> EndpointConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for EndpointConfig
impl Debug for EndpointConfig
Auto Trait Implementations
impl !RefUnwindSafe for EndpointConfig
impl Send for EndpointConfig
impl Sync for EndpointConfig
impl Unpin for EndpointConfig
impl !UnwindSafe for EndpointConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more