pub struct ReqwestClientDownloader { /* private fields */ }Expand description
Concrete implementation of Downloader using reqwest client
Implementations§
Source§impl ReqwestClientDownloader
impl ReqwestClientDownloader
Sourcepub fn new() -> ReqwestClientDownloader
pub fn new() -> ReqwestClientDownloader
Creates a new ReqwestClientDownloader with a default timeout of 30 seconds.
Sourcepub fn new_with_timeout(timeout: Duration) -> ReqwestClientDownloader
pub fn new_with_timeout(timeout: Duration) -> ReqwestClientDownloader
Creates a new ReqwestClientDownloader with a specified request timeout.
Sourcepub fn try_new_with_timeout(
timeout: Duration,
) -> Result<ReqwestClientDownloader, SpiderError>
pub fn try_new_with_timeout( timeout: Duration, ) -> Result<ReqwestClientDownloader, SpiderError>
Tries to create a new ReqwestClientDownloader with a specified request timeout.
Trait Implementations§
Source§impl Default for ReqwestClientDownloader
impl Default for ReqwestClientDownloader
Source§fn default() -> ReqwestClientDownloader
fn default() -> ReqwestClientDownloader
Returns the “default value” for a type. Read more
Source§impl Downloader for ReqwestClientDownloader
impl Downloader for ReqwestClientDownloader
Source§fn client(&self) -> &<ReqwestClientDownloader as Downloader>::Client
fn client(&self) -> &<ReqwestClientDownloader as Downloader>::Client
Returns a reference to the underlying HTTP client.
Source§fn download<'life0, 'async_trait>(
&'life0 self,
request: Request,
) -> Pin<Box<dyn Future<Output = Result<Response, SpiderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
ReqwestClientDownloader: 'async_trait,
fn download<'life0, 'async_trait>(
&'life0 self,
request: Request,
) -> Pin<Box<dyn Future<Output = Result<Response, SpiderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
ReqwestClientDownloader: 'async_trait,
Download a web page using the provided request.
This function focuses solely on executing the HTTP request. Read more
Auto Trait Implementations§
impl Freeze for ReqwestClientDownloader
impl !RefUnwindSafe for ReqwestClientDownloader
impl Send for ReqwestClientDownloader
impl Sync for ReqwestClientDownloader
impl Unpin for ReqwestClientDownloader
impl UnsafeUnpin for ReqwestClientDownloader
impl !UnwindSafe for ReqwestClientDownloader
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