pub struct CacheLayer<'a, P, R> { /* private fields */ }Expand description
Layer that adds cache to a tower::Service
This works by using a cache provider service that takes a ProviderRequest
and returns a ProviderResponse.
Implementations§
Source§impl<'a, P, R> CacheLayer<'a, P, R>
impl<'a, P, R> CacheLayer<'a, P, R>
Sourcepub fn new(provider: P) -> Self
pub fn new(provider: P) -> Self
Create a new CacheLayer
Trait Implementations§
Auto Trait Implementations§
impl<'a, P, R> Freeze for CacheLayer<'a, P, R>where
P: Freeze,
impl<'a, P, R> RefUnwindSafe for CacheLayer<'a, P, R>where
P: RefUnwindSafe,
R: RefUnwindSafe,
impl<'a, P, R> Send for CacheLayer<'a, P, R>
impl<'a, P, R> Sync for CacheLayer<'a, P, R>
impl<'a, P, R> Unpin for CacheLayer<'a, P, R>where
P: Unpin,
impl<'a, P, R> UnwindSafe for CacheLayer<'a, P, R>where
P: UnwindSafe,
R: RefUnwindSafe,
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