pub struct UpgradeHandler { /* private fields */ }Expand description
Pipe-provided hook that runs the post-upgrade protocol. The listener invokes it exactly once after writing the upgrade response head. The handler owns the socket for its lifetime; dropping the future closes the socket.
Implementations§
Source§impl UpgradeHandler
impl UpgradeHandler
pub fn new<F, Fut>(handler: F) -> Selfwhere
F: FnOnce(HijackedSocket) -> Fut + Send + 'static,
Fut: Future<Output = Result<(), ProximaError>> + Send + 'static,
pub fn invoke(self, socket: HijackedSocket) -> UpgradeFuture
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for UpgradeHandler
impl !Sync for UpgradeHandler
impl !UnwindSafe for UpgradeHandler
impl Freeze for UpgradeHandler
impl Send for UpgradeHandler
impl Unpin for UpgradeHandler
impl UnsafeUnpin for UpgradeHandler
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