Trait scrupy::downloader_middleware::DownloaderMiddleware [] [src]

pub trait DownloaderMiddleware: Send {
    fn process_request(&mut self, request: Request) -> MiddleWareResult;
    fn process_response(
        &mut self,
        request_content: &RequestContent,
        response: Response
    ) -> MiddleWareResult; fn process_exception(
        &mut self,
        request_content: &RequestContent,
        error: &DownloadError
    ) -> MiddleWareExceptionResult; }

It processes the request before it's sent to the downloader. Typical application includes setting the timeout and redirection policy.

Required Methods

Called when a Request is processed. The subsequent behaviour is determined by MiddleWareResult.

Called when a Response is processed. The subsequent behaviour is determined by MiddleWareResult.

Called when a DownloadError is processed. The subsequent behaviour is determined by MiddleWareExceptionResult.

Implementors