pub enum ServerProtocol {
Http1,
Http2,
Http3,
}Expand description
The wire protocol a server connection speaks.
The variant is selected at runtime from the server configuration, never at compile time: one binary serves every protocol it is configured for.
Variants§
Http1
HTTP/1.0 and HTTP/1.1 over a plain or TLS terminated byte stream.
Http2
HTTP/2, either with prior knowledge over a plain socket or negotiated
through h2 ALPN over TLS.
Http3
HTTP/3 over QUIC, which always terminates TLS inside its own handshake.
Implementations§
Source§impl ServerProtocol
Implementation block for ServerProtocol.
impl ServerProtocol
Implementation block for ServerProtocol.
Sourcepub fn get_alpn_protocol(&self) -> &'static [u8] ⓘ
pub fn get_alpn_protocol(&self) -> &'static [u8] ⓘ
Returns the ALPN protocol identifier used to negotiate this protocol.
The value is sent verbatim in the TLS handshake, so it must be the wire identifier and not the human-readable version string.
§Returns
&'static [u8]- The ALPN protocol identifier bytes.
Sourcepub fn get_version(&self) -> HttpVersion
pub fn get_version(&self) -> HttpVersion
Returns the HTTP version negotiated by this protocol.
§Returns
HttpVersion- The protocol’s HTTP version.
Trait Implementations§
Source§impl Clone for ServerProtocol
impl Clone for ServerProtocol
impl Copy for ServerProtocol
Source§impl Debug for ServerProtocol
impl Debug for ServerProtocol
Source§impl Default for ServerProtocol
impl Default for ServerProtocol
Source§impl<'de> Deserialize<'de> for ServerProtocol
impl<'de> Deserialize<'de> for ServerProtocol
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ServerProtocol
impl Display for ServerProtocol
impl Eq for ServerProtocol
Source§impl PartialEq for ServerProtocol
impl PartialEq for ServerProtocol
Source§impl Serialize for ServerProtocol
impl Serialize for ServerProtocol
impl StructuralPartialEq for ServerProtocol
Auto Trait Implementations§
impl Freeze for ServerProtocol
impl RefUnwindSafe for ServerProtocol
impl Send for ServerProtocol
impl Sync for ServerProtocol
impl Unpin for ServerProtocol
impl UnsafeUnpin for ServerProtocol
impl UnwindSafe for ServerProtocol
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.