pub struct Fetcher { /* private fields */ }Implementations§
Source§impl Fetcher
impl Fetcher
pub fn new(cfg: FetcherConfig) -> Result<Self, FetchError>
Sourcepub async fn fetch(&self, url: &Url) -> Result<FetchResult, FetchError>
pub async fn fetch(&self, url: &Url) -> Result<FetchResult, FetchError>
Fetches a page. Only HTML bodies are read, up to the configured cap.
Sourcepub async fn fetch_raw(
&self,
url: &Url,
max_bytes: usize,
) -> Result<FetchResult, FetchError>
pub async fn fetch_raw( &self, url: &Url, max_bytes: usize, ) -> Result<FetchResult, FetchError>
Fetches any resource (robots.txt, sitemaps) and reads up to max_bytes of its body.
Auto Trait Implementations§
impl !RefUnwindSafe for Fetcher
impl !UnwindSafe for Fetcher
impl Freeze for Fetcher
impl Send for Fetcher
impl Sync for Fetcher
impl Unpin for Fetcher
impl UnsafeUnpin for Fetcher
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