pub struct ConditionalMiddleware;Expand description
The middleware that answers a conditional request with 304 Not Modified.
Trait Implementations§
Source§impl Clone for ConditionalMiddleware
impl Clone for ConditionalMiddleware
impl Copy for ConditionalMiddleware
Source§impl Debug for ConditionalMiddleware
impl Debug for ConditionalMiddleware
Source§impl Default for ConditionalMiddleware
impl Default for ConditionalMiddleware
Source§impl ServerHook for ConditionalMiddleware
Implements ServerHook for ConditionalMiddleware.
impl ServerHook for ConditionalMiddleware
Implements ServerHook for ConditionalMiddleware.
Source§async fn handle(self, _: &mut Stream, ctx: &mut Context) -> Status
async fn handle(self, _: &mut Stream, ctx: &mut Context) -> Status
Answers a conditional request with 304 Not Modified while the validator matches.
Only a safe method can be answered with 304, because a request that
changes state has to reach the handler whether or not the representation
it addresses still matches. The body is dropped, so the response carries
the status and the representation metadata alone.
§Arguments
Self- The middleware.&mut Stream- The stream the request arrived on.&mut Context- The context of the request.
§Returns
Status- Whether the pipeline continues.
Auto Trait Implementations§
impl Forget for ConditionalMiddleware
impl Freeze for ConditionalMiddleware
impl Move for ConditionalMiddleware
impl RefUnwindSafe for ConditionalMiddleware
impl Send for ConditionalMiddleware
impl Sync for ConditionalMiddleware
impl Unpin for ConditionalMiddleware
impl UnsafeUnpin for ConditionalMiddleware
impl UnwindSafe for ConditionalMiddleware
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone 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