pub struct WebSocketUpgrade {
pub request: Request,
pub key: String,
pub version: String,
pub protocols: Vec<String>,
}Expand description
WebSocket upgrade request
Fields§
§request: RequestOriginal HTTP request
key: StringWebSocket key for handshake
version: StringWebSocket version
protocols: Vec<String>Requested protocols
Implementations§
Source§impl WebSocketUpgrade
impl WebSocketUpgrade
Sourcepub fn from_request(request: Request) -> Result<Self>
pub fn from_request(request: Request) -> Result<Self>
Create a new WebSocket upgrade from an HTTP request
Sourcepub fn accept<H>(self, handler: H) -> WebSocketResponse<H>where
H: WebSocketHandler,
pub fn accept<H>(self, handler: H) -> WebSocketResponse<H>where
H: WebSocketHandler,
Accept the WebSocket upgrade
Sourcepub fn generate_accept_key(&self) -> String
pub fn generate_accept_key(&self) -> String
Generate the proper WebSocket accept key according to RFC 6455
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WebSocketUpgrade
impl RefUnwindSafe for WebSocketUpgrade
impl Send for WebSocketUpgrade
impl Sync for WebSocketUpgrade
impl Unpin for WebSocketUpgrade
impl UnwindSafe for WebSocketUpgrade
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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 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>
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