pub struct CacheResponse { /* private fields */ }Expand description
Route middleware that caches a route’s successful GET responses, as #[CacheResponse] does in
PHP. Tags may name route parameters, such as orders:{order}.
A hit answers without running the middleware listed after this one, and this one only knows
about a user that earlier middleware signed in. List RequiresScope and Authenticate before
it, or a hit skips them and a signed-in user’s response is stored for guests.
route
.get("/orders/{order}", show)
.middleware(fusion_stack::CacheResponse::new(60).tags(["orders:{order}", "customers"]));Implementations§
Trait Implementations§
Source§impl Clone for CacheResponse
impl Clone for CacheResponse
Auto Trait Implementations§
impl Forget for CacheResponse
impl Freeze for CacheResponse
impl Move for CacheResponse
impl RefUnwindSafe for CacheResponse
impl Send for CacheResponsewhere
RawVecInner: Send,
impl Sync for CacheResponsewhere
RawVecInner: Sync,
impl Unpin for CacheResponse
impl UnsafeUnpin for CacheResponse
impl UnwindSafe for CacheResponsewhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<M> IntoMiddleware for Mwhere
M: Middleware,
impl<M> IntoMiddleware for Mwhere
M: Middleware,
Source§fn into_group(self) -> MiddlewareGroup
fn into_group(self) -> MiddlewareGroup
Convert into a group.