#[derive(Debug, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)]
pub enum SupportedTlsVersions
{
Only_TLS_v1_2,
Only_TLS_v1_3,
TLS_v1_3_and_TLS_v1_2,
}
impl Default for SupportedTlsVersions
{
#[inline(always)]
fn default() -> Self
{
SupportedTlsVersions::TLS_v1_3_and_TLS_v1_2
}
}
impl SupportedTlsVersions
{
#[inline(always)]
pub(crate) fn versions(self) -> Vec<ProtocolVersion>
{
use self::SupportedTlsVersions::*;
use self::ProtocolVersion::*;
match self
{
Only_TLS_v1_2 => vec![TLSv1_2],
Only_TLS_v1_3 => vec![TLSv1_3],
TLS_v1_3_and_TLS_v1_2 => vec![TLSv1_3, TLSv1_2],
}
}
}