pub struct HttpCacheMiddleware { /* private fields */ }Expand description
File-backed HTTP response cache middleware. Middleware that caches successful HTTP responses on disk.
Implementations§
Source§impl HttpCacheMiddleware
impl HttpCacheMiddleware
Sourcepub fn builder() -> HttpCacheMiddlewareBuilder
pub fn builder() -> HttpCacheMiddlewareBuilder
Creates a new HttpCacheMiddlewareBuilder to start building an HttpCacheMiddleware.
Trait Implementations§
Source§impl Debug for HttpCacheMiddleware
impl Debug for HttpCacheMiddleware
Source§impl<C> Middleware<C> for HttpCacheMiddleware
impl<C> Middleware<C> for HttpCacheMiddleware
Source§fn process_request<'life0, 'life1, 'async_trait>(
&'life0 self,
_client: &'life1 C,
request: Request,
) -> Pin<Box<dyn Future<Output = Result<MiddlewareAction<Request>, SpiderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
HttpCacheMiddleware: 'async_trait,
fn process_request<'life0, 'life1, 'async_trait>(
&'life0 self,
_client: &'life1 C,
request: Request,
) -> Pin<Box<dyn Future<Output = Result<MiddlewareAction<Request>, SpiderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
HttpCacheMiddleware: 'async_trait,
Intercepts an outgoing request before the downloader runs. Read more
Source§fn process_response<'life0, 'async_trait>(
&'life0 self,
response: Response,
) -> Pin<Box<dyn Future<Output = Result<MiddlewareAction<Response>, SpiderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
HttpCacheMiddleware: 'async_trait,
fn process_response<'life0, 'async_trait>(
&'life0 self,
response: Response,
) -> Pin<Box<dyn Future<Output = Result<MiddlewareAction<Response>, SpiderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
HttpCacheMiddleware: 'async_trait,
Intercepts a successful response after download. Read more
Source§fn handle_error<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_request: &'life1 Request,
error: &'life2 SpiderError,
) -> Pin<Box<dyn Future<Output = Result<MiddlewareAction<Request>, SpiderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn handle_error<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_request: &'life1 Request,
error: &'life2 SpiderError,
) -> Pin<Box<dyn Future<Output = Result<MiddlewareAction<Request>, SpiderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Handles downloader errors for a request. Read more
Auto Trait Implementations§
impl Freeze for HttpCacheMiddleware
impl RefUnwindSafe for HttpCacheMiddleware
impl Send for HttpCacheMiddleware
impl Sync for HttpCacheMiddleware
impl Unpin for HttpCacheMiddleware
impl UnwindSafe for HttpCacheMiddleware
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