pub struct OnUpgrade { /* private fields */ }Expand description
Handle to finish an HTTP upgrade (e.g. WebSocket).
Prefer ordinary routes + crate::Request::on_upgrade over crate::Router::raw.
Implementations§
Source§impl OnUpgrade
impl OnUpgrade
Sourcepub async fn upgrade(self) -> Result<(Upgraded, UpgradePermit), Error>
pub async fn upgrade(self) -> Result<(Upgraded, UpgradePermit), Error>
Complete the protocol upgrade.
Keep the returned UpgradePermit (or the whole tuple) alive for the
lifetime of the upgraded connection so the budget slot stays reserved.
Auto Trait Implementations§
impl Freeze for OnUpgrade
impl RefUnwindSafe for OnUpgrade
impl Send for OnUpgrade
impl Sync for OnUpgrade
impl Unpin for OnUpgrade
impl UnsafeUnpin for OnUpgrade
impl UnwindSafe for OnUpgrade
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