Skip to main content

FetchConfig

Struct FetchConfig 

Source
pub struct FetchConfig {
Show 17 fields pub concurrency: usize, pub timeout: Duration, pub connect_timeout: Duration, pub max_redirects: usize, pub max_body_bytes: usize, pub retries: u32, pub retry_backoff: Duration, pub per_host_delay: Duration, pub respect_robots: bool, pub respect_crawl_delay: bool, pub impersonate: Impersonate, pub accept_language: String, pub browser_fallback: bool, pub proxies: Vec<String>, pub max_retry_after: Duration, pub cookie_file: Option<PathBuf>, pub allow_private_hosts: bool,
}
Expand description

Everything tunable about fetching.

Fields§

§concurrency: usize

Maximum requests in flight across all hosts.

§timeout: Duration

Total per-request deadline.

§connect_timeout: Duration

Connection establishment deadline.

§max_redirects: usize

Redirects followed before giving up.

§max_body_bytes: usize

Hard cap on a response body. Enforced while streaming, so an oversized body costs one chunk, not the whole download.

§retries: u32

Retries for retryable failures.

§retry_backoff: Duration

Base delay for exponential backoff between retries.

§per_host_delay: Duration

Minimum spacing between two requests to the same host.

§respect_robots: bool

Honour robots.txt. Leave this on unless you own the target.

§respect_crawl_delay: bool

Honour a Crawl-delay larger than FetchConfig::per_host_delay.

§impersonate: Impersonate

Browser fingerprint to present.

§accept_language: String

Accept-Language header.

§browser_fallback: bool

Escalate JS-gated pages to headless Chrome. Needs the browser feature.

§proxies: Vec<String>

Proxies to route requests through, rotated round-robin.

The only real answer to IP-reputation blocking: a TLS fingerprint says what your client is, and an address says who it is. Accepts http://, https:// and socks5:// URLs, with optional user:pass@.

§max_retry_after: Duration

Honour a Retry-After header, up to this long. Set to zero to ignore it.

§cookie_file: Option<PathBuf>

File to persist cookies to, so a session survives the process.

§allow_private_hosts: bool

Allow loopback, private and link-local addresses as fetch targets.

Off by default. A search result or a redirect can point at 169.254.169.254 or at a service bound to the machine running this, and whatever comes back is extracted into a context window destined for a model – which turns an ordinary crawl into a way to read the cloud metadata endpoint out loud. Turn it on to crawl your own development server.

Trait Implementations§

Source§

impl Clone for FetchConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FetchConfig

Hand-written rather than derived: FetchConfig::proxies can carry user:pass@, and a derived Debug would put those credentials into any log that dumps a Fetcher or a Pipeline. Shows the fields worth seeing in a dump; .. covers the rest, so a new field cannot reintroduce a leak.

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FetchConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.