pub struct WebSocketUpgrade { /* private fields */ }Expand description
Extractor that represents a pending WebSocket upgrade. A handler takes it as
an argument, then calls on_upgrade.
Extraction fails with 426 Upgrade Required if the request is not a valid WebSocket handshake.
Implementations§
Source§impl WebSocketUpgrade
impl WebSocketUpgrade
Sourcepub fn on_upgrade<F, Fut>(self, callback: F) -> Response
pub fn on_upgrade<F, Fut>(self, callback: F) -> Response
Finish the handshake: spawn a task that runs callback with the
established WebSocket once the upgrade completes, and return the
101 Switching Protocols response the engine will send.
Trait Implementations§
Source§impl FromCallParts for WebSocketUpgrade
impl FromCallParts for WebSocketUpgrade
Auto Trait Implementations§
impl !Freeze for WebSocketUpgrade
impl RefUnwindSafe for WebSocketUpgrade
impl Send for WebSocketUpgrade
impl Sync for WebSocketUpgrade
impl Unpin for WebSocketUpgrade
impl UnsafeUnpin 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