Struct quinn_proto::ServerConfig
source · [−]pub struct ServerConfig {
pub transport: Arc<TransportConfig>,
pub crypto: Arc<dyn ServerConfig>,
/* private fields */
}
Expand description
Parameters governing incoming connections
Default values should be suitable for most internet applications.
Fields
transport: Arc<TransportConfig>
Transport configuration to use for incoming connections
crypto: Arc<dyn ServerConfig>
TLS configuration used for incoming connections.
Must be set to use TLS 1.3 only.
Implementations
sourceimpl ServerConfig
impl ServerConfig
sourcepub fn new(
crypto: Arc<dyn ServerConfig>,
token_key: Arc<dyn HandshakeTokenKey>
) -> Self
pub fn new(
crypto: Arc<dyn ServerConfig>,
token_key: Arc<dyn HandshakeTokenKey>
) -> Self
Create a default config with a particular handshake token key
sourcepub fn token_key(
&mut self,
value: Arc<dyn HandshakeTokenKey>
) -> Result<&mut Self, ConfigError>
pub fn token_key(
&mut self,
value: Arc<dyn HandshakeTokenKey>
) -> Result<&mut Self, ConfigError>
Private key used to authenticate data included in handshake tokens.
sourcepub fn use_retry(&mut self, value: bool) -> &mut Self
pub fn use_retry(&mut self, value: bool) -> &mut Self
Whether to require clients to prove ownership of an address before committing resources.
Introduces an additional round-trip to the handshake to make denial of service attacks more difficult.
sourcepub fn retry_token_lifetime(&mut self, value: Duration) -> &mut Self
pub fn retry_token_lifetime(&mut self, value: Duration) -> &mut Self
Duration after a stateless retry token was issued for which it’s considered valid.
sourcepub fn concurrent_connections(&mut self, value: u32) -> &mut Self
pub fn concurrent_connections(&mut self, value: u32) -> &mut Self
Maximum number of simultaneous connections to accept.
New incoming connections are only accepted if the total number of incoming or outgoing connections is less than this. Outgoing connections are unaffected.
sourceimpl ServerConfig
impl ServerConfig
sourcepub fn with_single_cert(
cert_chain: Vec<Certificate>,
key: PrivateKey
) -> Result<Self, Error>
pub fn with_single_cert(
cert_chain: Vec<Certificate>,
key: PrivateKey
) -> Result<Self, Error>
Create a server config with the given certificate chain to be presented to clients
Uses a randomized handshake token key.
sourcepub fn with_crypto(crypto: Arc<ServerConfig>) -> Self
pub fn with_crypto(crypto: Arc<ServerConfig>) -> Self
Create a server config with the given rustls::ServerConfig
Uses a randomized handshake token key.
Trait Implementations
sourceimpl Clone for ServerConfig
impl Clone for ServerConfig
sourcefn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
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
Auto Trait Implementations
impl !RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl !UnwindSafe for ServerConfig
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