pub struct ProtocolDetector;Expand description
Helper object; currently stateless but separated to isolate feature-gated
code behind cfg(feature = "tls").
Additional detection strategies (e.g., Prior-Knowledge preface sniffing) could be added here in the future without touching call-sites.
Implementations§
Source§impl ProtocolDetector
impl ProtocolDetector
Sourcepub fn detect_from_alpn(alpn_protocol: Option<&[u8]>) -> HttpProtocol
Available on crate feature tls only.
pub fn detect_from_alpn(alpn_protocol: Option<&[u8]>) -> HttpProtocol
tls only.Inspect the ALPN value produced by the TLS handshake and translate it
into an HttpProtocol.
If the binary is built without the tls feature this function is
compiled to a stub that always returns HttpProtocol::Auto, allowing
non-TLS builds to link without conditional logic in the caller.
Auto Trait Implementations§
impl Freeze for ProtocolDetector
impl RefUnwindSafe for ProtocolDetector
impl Send for ProtocolDetector
impl Sync for ProtocolDetector
impl Unpin for ProtocolDetector
impl UnwindSafe for ProtocolDetector
Blanket Implementations§
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