#[non_exhaustive]pub struct UpgradeRequest<E, B = ()> {
pub key: Bytes,
pub subprotocol: Option<String>,
pub extension: Option<E>,
pub request: Request<B>,
pub extension_header: Option<HeaderValue>,
}Expand description
Represents a parsed WebSocket connection upgrade HTTP request.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.key: BytesThe security key provided by the client during the WebSocket handshake.
This key is used by the server to generate a response key, confirming that the server accepts the WebSocket upgrade request.
subprotocol: Option<String>The optional WebSocket subprotocol agreed upon during the handshake.
The subprotocol is used to define the application-specific communication on top of the
WebSocket connection, such as wamp or graphql-ws. If no subprotocol is requested or
agreed upon, this will be None.
extension: Option<E>The optional WebSocket extension negotiated during the handshake.
Extensions allow WebSocket connections to have additional functionality, such as compression
or multiplexing. This field represents any such negotiated extension, or None if no
extensions were negotiated.
request: Request<B>The original HTTP request that initiated the WebSocket upgrade.
extension_header: Option<HeaderValue>The optional Sec-WebSocket-Extensions header value from the HTTP request.
This header may contain the raw extension details sent by the client during the handshake.
If no extension was requested, this field will be None.
Trait Implementations§
Auto Trait Implementations§
impl<E, B = ()> !Freeze for UpgradeRequest<E, B>
impl<E, B = ()> !RefUnwindSafe for UpgradeRequest<E, B>
impl<E, B = ()> !UnwindSafe for UpgradeRequest<E, B>
impl<E, B> Send for UpgradeRequest<E, B>
impl<E, B> Sync for UpgradeRequest<E, B>
impl<E, B> Unpin for UpgradeRequest<E, B>
impl<E, B> UnsafeUnpin for UpgradeRequest<E, B>where
E: UnsafeUnpin,
B: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more