pub struct WebSocketUpgrade { /* private fields */ }Expand description
WebSocket upgrade response
This type is returned from WebSocket handlers to initiate the upgrade handshake and establish a WebSocket connection.
Implementations§
Source§impl WebSocketUpgrade
impl WebSocketUpgrade
Sourcepub fn heartbeat(self, config: WsHeartbeatConfig) -> Self
pub fn heartbeat(self, config: WsHeartbeatConfig) -> Self
Enable WebSocket heartbeat
Sourcepub fn compress(self, config: WsCompressionConfig) -> Self
pub fn compress(self, config: WsCompressionConfig) -> Self
Enable WebSocket compression
Sourcepub fn on_upgrade<F, Fut>(self, callback: F) -> Self
pub fn on_upgrade<F, Fut>(self, callback: F) -> Self
Trait Implementations§
Source§impl IntoResponse for WebSocketUpgrade
impl IntoResponse for WebSocketUpgrade
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Convert self into a Response
Source§impl ResponseModifier for WebSocketUpgrade
impl ResponseModifier for WebSocketUpgrade
fn update_response(op: &mut Operation)
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<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