pub struct RequestMiddleware;Expand description
Request middleware that injects cache-control headers.
Sets Cache-Control: no-cache, no-store, must-revalidate, Pragma: no-cache,
and Expires: 0 on every response to prevent stale WASM assets during development.
Implementations§
Trait Implementations§
Source§impl ServerHook for RequestMiddleware
Implements ServerHook for RequestMiddleware to inject cache-control headers.
impl ServerHook for RequestMiddleware
Implements ServerHook for RequestMiddleware to inject cache-control headers.
Source§async fn handle(self, _: &mut Stream, ctx: &mut Context) -> Status
async fn handle(self, _: &mut Stream, ctx: &mut Context) -> Status
Injects cache-control headers to prevent stale WASM assets during development.
Sets Cache-Control: no-cache, no-store, must-revalidate,
Pragma: no-cache, and Expires: 0 on the response.
§Arguments
self- The consumed middleware instance.&mut Stream- The connection stream (unused).&mut Context- The request context used to set response headers.
§Returns
Status- The hook processing result.
Auto Trait Implementations§
impl Freeze for RequestMiddleware
impl RefUnwindSafe for RequestMiddleware
impl Send for RequestMiddleware
impl Sync for RequestMiddleware
impl Unpin for RequestMiddleware
impl UnsafeUnpin for RequestMiddleware
impl UnwindSafe for RequestMiddleware
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