use std::fmt;
#[non_exhaustive]
#[derive(Clone, Copy)]
pub enum Protocol {
Udp,
Tcp,
Tls,
Dtls,
Https,
Quic,
}
impl fmt::Display for Protocol {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
let s = match self {
Self::Udp => "UDP",
Self::Tcp => "TCP",
Self::Tls => "TLS",
Self::Dtls => "DTLS",
Self::Https => "HTTPS",
Self::Quic => "QUIC",
};
f.write_str(s)
}
}
impl fmt::Debug for Protocol {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
fmt::Display::fmt(self, f)
}
}