pub struct Protocol {
inner: Protocol,
}
Expand description
Extension type representing the :protocol
pseudo-header in HTTP/2.
The Protocol
extension allows access to the value of the :protocol
pseudo-header
used by the Extended CONNECT Protocol.
This extension is only sent on HTTP/2 CONNECT requests, most commonly with the value websocket
.
§Example
use hyper::ext::Protocol;
use http::{Request, Method, Version};
let mut req = Request::new(());
*req.method_mut() = Method::CONNECT;
*req.version_mut() = Version::HTTP_2;
req.extensions_mut().insert(Protocol::from_static("websocket"));
// Now the request will include the `:protocol` pseudo-header with value "websocket"
Fields§
§inner: Protocol
Implementations§
Trait Implementations§
impl Eq for Protocol
impl StructuralPartialEq for Protocol
Auto Trait Implementations§
impl !Freeze for Protocol
impl RefUnwindSafe for Protocol
impl Send for Protocol
impl Sync for Protocol
impl Unpin for Protocol
impl UnwindSafe for Protocol
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.