Skip to main content

UpgradeRequest

Struct UpgradeRequest 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§key: Bytes

The 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§

Source§

impl<E: Debug, B: Debug> Debug for UpgradeRequest<E, B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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>
where E: Send, B: Send,

§

impl<E, B> Sync for UpgradeRequest<E, B>
where E: Sync, B: Sync,

§

impl<E, B> Unpin for UpgradeRequest<E, B>
where E: Unpin, B: Unpin,

§

impl<E, B> UnsafeUnpin for UpgradeRequest<E, B>
where E: UnsafeUnpin, B: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V