#[non_exhaustive]pub struct ConnectionParams<'a> {
pub settings: QuicSettings,
pub tls_cert: Option<TlsCertificatePaths<'a>>,
pub hooks: Hooks,
pub session: Option<Vec<u8>>,
}Expand description
Combined configuration parameters required to establish a QUIC connection.
ConnectionParams aggregates the parameters required for all QUIC
connections, regardless of whether it’s a client- or server-side connection.
To construct them, either ConnectionParams::new_server or
ConnectionParams::new_client must be used. The parameters can be modified
freely after construction.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.settings: QuicSettingsQUIC connection settings.
tls_cert: Option<TlsCertificatePaths<'a>>Optional TLS credentials to authenticate with.
hooks: HooksHooks to use for the connection.
session: Option<Vec<u8>>Set the session to attempt resumption.
Implementations§
Source§impl<'a> ConnectionParams<'a>
impl<'a> ConnectionParams<'a>
Sourcepub fn new_server(
settings: QuicSettings,
tls_cert: TlsCertificatePaths<'a>,
hooks: Hooks,
) -> Self
pub fn new_server( settings: QuicSettings, tls_cert: TlsCertificatePaths<'a>, hooks: Hooks, ) -> Self
Creates ConnectionParams for a QUIC server.
Servers should always specify TLS credentials.
Sourcepub fn new_client(
settings: QuicSettings,
tls_cert: Option<TlsCertificatePaths<'a>>,
hooks: Hooks,
) -> Self
pub fn new_client( settings: QuicSettings, tls_cert: Option<TlsCertificatePaths<'a>>, hooks: Hooks, ) -> Self
Creates ConnectionParams for a QUIC client.
Clients may enable mTLS by specifying TLS credentials.
Trait Implementations§
Source§impl Debug for ConnectionParams<'_>
impl Debug for ConnectionParams<'_>
Source§impl<'a> Default for ConnectionParams<'a>
impl<'a> Default for ConnectionParams<'a>
Source§fn default() -> ConnectionParams<'a>
fn default() -> ConnectionParams<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for ConnectionParams<'a>
impl<'a> !RefUnwindSafe for ConnectionParams<'a>
impl<'a> Send for ConnectionParams<'a>
impl<'a> Sync for ConnectionParams<'a>
impl<'a> Unpin for ConnectionParams<'a>
impl<'a> !UnwindSafe for ConnectionParams<'a>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more