pub struct ResponseMiddleware;Expand description
Response middleware that writes the serialized response to the stream.
Builds the HTTP response bytes and sends them through the connection stream, closing the stream if the send fails.
Implementations§
Trait Implementations§
Source§impl ServerHook for ResponseMiddleware
Implements ServerHook for ResponseMiddleware to serialize and send the response.
impl ServerHook for ResponseMiddleware
Implements ServerHook for ResponseMiddleware to serialize and send the response.
Source§async fn handle(self, stream: &mut Stream, ctx: &mut Context) -> Status
async fn handle(self, stream: &mut Stream, ctx: &mut Context) -> Status
Builds the HTTP response bytes and sends them through the connection stream.
If the send fails, marks the stream as closed and rejects the request.
§Arguments
self- The consumed middleware instance.&mut Stream- The connection stream used to send the response bytes.&mut Context- The request context used to build the response.
§Returns
Status- The hook processing result.
Auto Trait Implementations§
impl Freeze for ResponseMiddleware
impl RefUnwindSafe for ResponseMiddleware
impl Send for ResponseMiddleware
impl Sync for ResponseMiddleware
impl Unpin for ResponseMiddleware
impl UnsafeUnpin for ResponseMiddleware
impl UnwindSafe for ResponseMiddleware
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendSync for T
impl<T> AnySync for T
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