pub enum UpgradeType {
WebSocket,
H2c,
Tls(String),
Unknown(String),
}Expand description
Represents different upgrade types.
Variants§
WebSocket
WebSocket protocol upgrade
H2c
HTTP/2 cleartext upgrade (h2c)
Tls(String)
TLS upgrade (rare, experimental)
Unknown(String)
Other custom or unknown upgrade protocols
Implementations§
Source§impl UpgradeType
impl UpgradeType
Sourcepub fn is_ws(&self) -> bool
pub fn is_ws(&self) -> bool
Checks if the current upgrade type is WebSocket.
-
&self- The current instance of the enum. -
Returns
trueifselfisSelf::WebSocket, otherwisefalse.
Sourcepub fn is_h2c(&self) -> bool
pub fn is_h2c(&self) -> bool
Checks if the current upgrade type is HTTP/2 cleartext (h2c).
-
&self- The current instance of the enum. -
Returns
trueifselfisSelf::H2c, otherwisefalse.
Sourcepub fn is_tls(&self) -> bool
pub fn is_tls(&self) -> bool
Checks if the current upgrade type is a TLS variant (any version).
-
&self- The current instance of the enum. -
Returns
trueifselfmatchesSelf::Tls(_), otherwisefalse.
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Checks if the current upgrade type is unknown (neither WebSocket, H2c, nor Tls).
-
&self- The current instance of the enum. -
Returns
trueifselfis none of the known upgrade types, otherwisefalse.
Trait Implementations§
Source§impl Clone for UpgradeType
impl Clone for UpgradeType
Source§fn clone(&self) -> UpgradeType
fn clone(&self) -> UpgradeType
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read more