#[non_exhaustive]pub struct ConnectionParams<'a> {
pub settings: QuicSettings,
pub tls_cert: Option<TlsCertificatePaths<'a>>,
pub hooks: Hooks,
pub session: Option<Vec<u8>>,
pub dcid: Option<ConnectionId<'static>>,
}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
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.
dcid: Option<ConnectionId<'static>>Custom destination connection ID to use for client connections.
Be aware that RFC 9000 places requirements for unpredictability and length on the client DCID field. Setting this field is dangerous if these requirements are not satisfied.
Has no effect on server-side ConnectionParams.
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>
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> UnsafeUnpin for ConnectionParams<'a>
impl<'a> !UnwindSafe for ConnectionParams<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
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>
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>
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