pub struct ClientBuilder { /* private fields */ }Expand description
Builder for Client.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Per-request timeout (covers connect, headers, and body read).
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
TCP-connect timeout, applied independently of the request timeout.
Sourcepub fn user_agent(self, user_agent: impl Into<String>) -> Self
pub fn user_agent(self, user_agent: impl Into<String>) -> Self
Override the User-Agent header sent on every request.
Sourcepub fn follow_redirects(self, follow: bool) -> Self
pub fn follow_redirects(self, follow: bool) -> Self
Toggle automatic redirect following. Defaults to true; disable when
using crate::Signal::RedirectAbsent is undesirable for a run.
Sourcepub fn min_request_interval(self, interval: Duration) -> Self
pub fn min_request_interval(self, interval: Duration) -> Self
Minimum time between consecutive requests to the same host.
Defaults to 100 ms (≈ 10 RPS per host) — enough headroom to avoid rate-limit responses on common OSINT targets while keeping fan-out across many sites fast.
Sourcepub fn max_rps(self, rps: NonZeroU32) -> Self
pub fn max_rps(self, rps: NonZeroU32) -> Self
Cap the total request rate across all hosts to rps requests per
second. Independent of (and composed with) the per-host interval —
useful on a metered connection or behind a shared-quota proxy.
Uncapped by default.
Sourcepub fn max_retries(self, n: u32) -> Self
pub fn max_retries(self, n: u32) -> Self
Maximum retry attempts after a transient ban response. Defaults to 2
(so up to 3 total tries). Set to 0 to disable retry entirely.
Sourcepub fn base_backoff_delay(self, d: Duration) -> Self
pub fn base_backoff_delay(self, d: Duration) -> Self
Base delay for the first retry. Subsequent retries double until
reaching Self::max_backoff_delay. Defaults to 500 ms.
Sourcepub fn max_backoff_delay(self, d: Duration) -> Self
pub fn max_backoff_delay(self, d: Duration) -> Self
Cap on a single backoff delay (pre-jitter). Defaults to 30 s.
Sourcepub fn proxy(self, url: impl Into<String>) -> Self
pub fn proxy(self, url: impl Into<String>) -> Self
Route all requests through a proxy. Accepts http://, https://,
and socks5:// URLs. For Tor, pass socks5://127.0.0.1:9050.
Sourcepub fn rotate_user_agents(self, agents: Vec<String>) -> Self
pub fn rotate_user_agents(self, agents: Vec<String>) -> Self
Rotate the User-Agent header per request, picking uniformly at
random from agents. An empty list (the default) keeps the single
fixed User-Agent. Useful for reducing trivial fingerprinting.
Sourcepub fn enrich(self, enrich: bool) -> Self
pub fn enrich(self, enrich: bool) -> Self
Extract profile fields (per crate::Site::extract) from Found
pages. Off by default; enables an extra body read for matching sites.
Sourcepub fn respect_robots(self, respect: bool) -> Self
pub fn respect_robots(self, respect: bool) -> Self
Honor each host’s robots.txt: probes to disallowed paths are
skipped (reported Uncertain, note robots_disallowed). Off by
default. Adds one cached robots.txt fetch per origin.
Sourcepub fn browser(self, backend: Arc<dyn BrowserBackend>) -> Self
pub fn browser(self, backend: Arc<dyn BrowserBackend>) -> Self
Attach a browser backend. Sites tagged bot-protected will be
routed through it instead of the raw HTTP path, up to the
browser_budget cap.
Sourcepub const fn browser_budget(self, cap: usize) -> Self
pub const fn browser_budget(self, cap: usize) -> Self
Per-scan cap on how many bot-protected sites are allowed to use
the browser backend. Once exhausted, the rest fall back to
Uncertain(BrowserBudget). Defaults to
DEFAULT_BROWSER_BUDGET.
Trait Implementations§
Source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
Source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more