#[non_exhaustive]pub enum TlsVersion {
Tls10,
Tls11,
Tls12,
Tls13,
}Expand description
Minimum TLS protocol version supported by a TlsConfigProvider.
Used for security auditing and warning generation. Providers that allow
versions below Tls12 should emit a warning via
WarningCollector.
#[non_exhaustive]: a later TLS version may be added, so a match
outside quack-rs needs a wildcard arm; comparisons (>= TlsVersion::Tls12) keep working.
ⓘ
use quack_rs::tls::TlsVersion;
fn modern(version: TlsVersion) -> bool {
match version {
TlsVersion::Tls10 | TlsVersion::Tls11 => false,
TlsVersion::Tls12 | TlsVersion::Tls13 => true,
// error[E0004]: a wildcard arm is required
}
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Tls10
TLS 1.0 — deprecated per RFC 8996.
Tls11
TLS 1.1 — deprecated per RFC 8996.
Tls12
TLS 1.2 — minimum recommended version.
Tls13
TLS 1.3 — preferred version.
Implementations§
Source§impl TlsVersion
impl TlsVersion
Sourcepub const fn is_deprecated(self) -> bool
pub const fn is_deprecated(self) -> bool
Returns true if this version is considered deprecated (TLS 1.0 or 1.1).
Trait Implementations§
Source§impl Clone for TlsVersion
impl Clone for TlsVersion
Source§fn clone(&self) -> TlsVersion
fn clone(&self) -> TlsVersion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TlsVersion
Source§impl Debug for TlsVersion
impl Debug for TlsVersion
Source§impl Display for TlsVersion
impl Display for TlsVersion
impl Eq for TlsVersion
Source§impl Hash for TlsVersion
impl Hash for TlsVersion
Source§impl Ord for TlsVersion
impl Ord for TlsVersion
Source§fn cmp(&self, other: &TlsVersion) -> Ordering
fn cmp(&self, other: &TlsVersion) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for TlsVersion
impl PartialEq for TlsVersion
Source§impl PartialOrd for TlsVersion
impl PartialOrd for TlsVersion
impl StructuralPartialEq for TlsVersion
Auto Trait Implementations§
impl Freeze for TlsVersion
impl RefUnwindSafe for TlsVersion
impl Send for TlsVersion
impl Sync for TlsVersion
impl Unpin for TlsVersion
impl UnsafeUnpin for TlsVersion
impl UnwindSafe for TlsVersion
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
Mutably borrows from an owned value. Read more