@@ -1035,6 +1035,89 @@ impl From<DateTime> for i64 {
1035
1035
}
1036
1036
}
1037
1037
1038
+ impl TlsVersion {
1039
+ pub fn as_str ( & self ) -> & ' static str {
1040
+ match self {
1041
+ TlsVersion :: SSLv2 => "SSLv2" ,
1042
+ TlsVersion :: SSLv3 => "SSLv3" ,
1043
+ TlsVersion :: TLSv1_0 => "TLSv1.0" ,
1044
+ TlsVersion :: TLSv1_1 => "TLSv1.1" ,
1045
+ TlsVersion :: TLSv1_2 => "TLSv1.2" ,
1046
+ TlsVersion :: TLSv1_3 => "TLSv1.3" ,
1047
+ TlsVersion :: DTLSv1_0 => "DTLSv1.0" ,
1048
+ TlsVersion :: DTLSv1_2 => "DTLSv1.2" ,
1049
+ TlsVersion :: DTLSv1_3 => "DTLSv1.3" ,
1050
+ }
1051
+ }
1052
+ }
1053
+
1054
+ impl Greeting {
1055
+ pub fn as_str ( & self ) -> & ' static str {
1056
+ match self {
1057
+ Greeting :: Helo => "HELO" ,
1058
+ Greeting :: Ehlo => "EHLO" ,
1059
+ Greeting :: Lhlo => "LHLO" ,
1060
+ }
1061
+ }
1062
+ }
1063
+
1064
+ impl Protocol {
1065
+ pub fn as_str ( & self ) -> & ' static str {
1066
+ match self {
1067
+ Protocol :: SMTP => "SMTP" ,
1068
+ Protocol :: LMTP => "LMTP" ,
1069
+ Protocol :: ESMTP => "ESMTP" ,
1070
+ Protocol :: ESMTPS => "ESMTPS" ,
1071
+ Protocol :: ESMTPA => "ESMTPA" ,
1072
+ Protocol :: ESMTPSA => "ESMTPSA" ,
1073
+ Protocol :: LMTPA => "LMTPA" ,
1074
+ Protocol :: LMTPS => "LMTPS" ,
1075
+ Protocol :: LMTPSA => "LMTPSA" ,
1076
+ Protocol :: UTF8SMTP => "UTF8SMTP" ,
1077
+ Protocol :: UTF8SMTPA => "UTF8SMTPA" ,
1078
+ Protocol :: UTF8SMTPS => "UTF8SMTPS" ,
1079
+ Protocol :: UTF8SMTPSA => "UTF8SMTPSA" ,
1080
+ Protocol :: UTF8LMTP => "UTF8LMTP" ,
1081
+ Protocol :: UTF8LMTPA => "UTF8LMTPA" ,
1082
+ Protocol :: UTF8LMTPS => "UTF8LMTPS" ,
1083
+ Protocol :: UTF8LMTPSA => "UTF8LMTPSA" ,
1084
+ Protocol :: HTTP => "HTTP" ,
1085
+ Protocol :: HTTPS => "HTTPS" ,
1086
+ Protocol :: IMAP => "IMAP" ,
1087
+ Protocol :: POP3 => "POP3" ,
1088
+ Protocol :: MMS => "MMS" ,
1089
+ Protocol :: Local => "Local" ,
1090
+ }
1091
+ }
1092
+ }
1093
+
1094
+ impl Display for Host < ' _ > {
1095
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1096
+ match self {
1097
+ Host :: Name ( name) => name. fmt ( f) ,
1098
+ Host :: IpAddr ( ip) => ip. fmt ( f) ,
1099
+ }
1100
+ }
1101
+ }
1102
+
1103
+ impl Display for Protocol {
1104
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1105
+ f. write_str ( self . as_str ( ) )
1106
+ }
1107
+ }
1108
+
1109
+ impl Display for Greeting {
1110
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1111
+ f. write_str ( self . as_str ( ) )
1112
+ }
1113
+ }
1114
+
1115
+ impl Display for TlsVersion {
1116
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1117
+ f. write_str ( self . as_str ( ) )
1118
+ }
1119
+ }
1120
+
1038
1121
impl Display for HeaderName < ' _ > {
1039
1122
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1040
1123
write ! ( f, "{}" , self . as_str( ) )
0 commit comments