pub struct Upgrade<F> { /* private fields */ }Expand description
A request to upgrade the HTTP/1 connection.
Implementations§
Source§impl<F: Filter> Upgrade<F>
impl<F: Filter> Upgrade<F>
Sourcepub fn ack(self) -> ControlAck<F>
pub fn ack(self) -> ControlAck<F>
Passes the upgrade request to the application service.
The application can take ownership of the connection and codec through
RequestHead::take_io.
Sourcepub fn handle(self) -> (ControlAck<F>, Io<F>, Request, Codec)
pub fn handle(self) -> (ControlAck<F>, Io<F>, Request, Codec)
Takes ownership of the connection, request, and codec.
Returning this acknowledgement tells the dispatcher that the control service is responsible for the upgraded connection.
Sourcepub fn fail<E: ResponseError>(self, err: E) -> ControlAck<F>
pub fn fail<E: ResponseError>(self, err: E) -> ControlAck<F>
Rejects the upgrade with the response generated from err.
Sourcepub fn fail_with(self, res: Response) -> ControlAck<F>
pub fn fail_with(self, res: Response) -> ControlAck<F>
Rejects the upgrade with a custom response.
Trait Implementations§
Auto Trait Implementations§
impl<F> !Freeze for Upgrade<F>
impl<F> !RefUnwindSafe for Upgrade<F>
impl<F> !Send for Upgrade<F>
impl<F> !Sync for Upgrade<F>
impl<F> !UnwindSafe for Upgrade<F>
impl<F> Unpin for Upgrade<F>
impl<F> UnsafeUnpin for Upgrade<F>
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