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§impl ResponseModifier for WebSocketUpgrade
impl ResponseModifier for WebSocketUpgrade
Source§fn update_response(op: &mut Operation)
fn update_response(op: &mut Operation)
Update the operation with response information
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