Skip to main content

UpgradeResponseParts

Struct UpgradeResponseParts 

Source
#[non_exhaustive]
pub struct UpgradeResponseParts<E> { pub response: Response<()>, pub subprotocol: Option<String>, pub extension: Option<E>, }
Expand description

A negotiated WebSocket response and its configured subprotcol and extension, if any.

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.
§response: Response<()>

An http::Response<()>, which represents the WebSocket handshake response.

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

Trait Implementations§

Source§

impl<E: Debug> Debug for UpgradeResponseParts<E>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<E> !RefUnwindSafe for UpgradeResponseParts<E>

§

impl<E> !UnwindSafe for UpgradeResponseParts<E>

§

impl<E> Freeze for UpgradeResponseParts<E>
where E: Freeze,

§

impl<E> Send for UpgradeResponseParts<E>
where E: Send,

§

impl<E> Sync for UpgradeResponseParts<E>
where E: Sync,

§

impl<E> Unpin for UpgradeResponseParts<E>
where E: Unpin,

§

impl<E> UnsafeUnpin for UpgradeResponseParts<E>
where E: 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