pub struct Cache<S>(/* private fields */);Expand description
Implements a caching middleware for reqwest.
Implementations§
Source§impl<S: CacheStorage> Cache<S>
impl<S: CacheStorage> Cache<S>
Sourcepub fn new_with_options(storage: S, options: CacheOptions) -> Self
pub fn new_with_options(storage: S, options: CacheOptions) -> Self
Construct a new caching middleware with the given storage and options.
Trait Implementations§
Source§impl<S: CacheStorage> Middleware for Cache<S>
impl<S: CacheStorage> Middleware for Cache<S>
Source§fn handle<'a, 'b, 'c, 'd>(
&'a self,
req: Request,
extensions: &'b mut Extensions,
next: Next<'c>,
) -> BoxFuture<'d, Result<Response>>where
Self: 'd,
'a: 'd,
'b: 'd,
'c: 'd,
fn handle<'a, 'b, 'c, 'd>(
&'a self,
req: Request,
extensions: &'b mut Extensions,
next: Next<'c>,
) -> BoxFuture<'d, Result<Response>>where
Self: 'd,
'a: 'd,
'b: 'd,
'c: 'd,
Invoked with a request before sending it. If you want to continue processing the request,
you should explicitly call
next.run(req, extensions). Read moreAuto Trait Implementations§
impl<S> Freeze for Cache<S>where
S: Freeze,
impl<S> RefUnwindSafe for Cache<S>where
S: RefUnwindSafe,
impl<S> Send for Cache<S>where
S: Send,
impl<S> Sync for Cache<S>where
S: Sync,
impl<S> Unpin for Cache<S>where
S: Unpin,
impl<S> UnwindSafe for Cache<S>where
S: 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