pub struct HttpKindBuilder { /* private fields */ }Expand description
Configures HttpKind.
Implementations§
Source§impl HttpKindBuilder
impl HttpKindBuilder
Sourcepub fn http_client(self, client: Arc<dyn HttpClient>) -> Self
pub fn http_client(self, client: Arc<dyn HttpClient>) -> Self
Injects the HTTP transport.
Sourcepub fn coalesce_in_flight(self, enabled: bool) -> Self
pub fn coalesce_in_flight(self, enabled: bool) -> Self
Enables or disables optional in-flight request coalescing. It is disabled by default.
Sourcepub fn session_pool(self, options: SessionPoolOptions) -> Self
pub fn session_pool(self, options: SessionPoolOptions) -> Self
Enables sessions with the supplied pool options.
Uses an existing session pool without managing its persistence lifecycle.
With a shared pool, the component that owns the sharing (for example, the Phase 6 smart kind) attaches persistence exactly once. Otherwise, two kinds would double-restore and double-persist the same pool.
Sourcepub fn disable_sessions(self) -> Self
pub fn disable_sessions(self) -> Self
Disables session selection, cookie persistence, and session rotation.
Sourcepub fn proxy(self, proxy: ProxyConfiguration) -> Self
pub fn proxy(self, proxy: ProxyConfiguration) -> Self
Sets the default proxy bucket.
Sourcepub fn proxy_buckets(self, proxies: ProxyBuckets) -> Self
pub fn proxy_buckets(self, proxies: ProxyBuckets) -> Self
Replaces all logical proxy buckets.
Sourcepub fn proxy_strategy<S: ProxyStrategy>(self, strategy: S) -> Self
pub fn proxy_strategy<S: ProxyStrategy>(self, strategy: S) -> Self
Sets the policy that selects a proxy bucket per attempt.
Sourcepub fn user_agents<I, U>(self, user_agents: I) -> Self
pub fn user_agents<I, U>(self, user_agents: I) -> Self
Replaces the rotating User-Agent set.
Sourcepub fn retry_status_codes(self, codes: impl IntoIterator<Item = u16>) -> Self
pub fn retry_status_codes(self, codes: impl IntoIterator<Item = u16>) -> Self
Replaces the exact status codes classified as ordinary retries.
Sourcepub fn retry_server_errors(self, enabled: bool) -> Self
pub fn retry_server_errors(self, enabled: bool) -> Self
Controls whether every 5xx response is retried.
Sourcepub fn session_status_codes(self, codes: impl IntoIterator<Item = u16>) -> Self
pub fn session_status_codes(self, codes: impl IntoIterator<Item = u16>) -> Self
Replaces statuses that trigger the retry_on_blocked session-rotation behavior.
The default is 401 and 403. An empty list disables status-driven session rotation.
Sourcepub fn request_timeout(self, timeout: Duration) -> Self
pub fn request_timeout(self, timeout: Duration) -> Self
Sets the HTTP request deadline corresponding to §20.5’s navigation_timeout option.
Sourcepub fn max_redirects(self, maximum: u32) -> Self
pub fn max_redirects(self, maximum: u32) -> Self
Sets the maximum number of redirects followed for one request.
Sourcepub fn detect_anti_bot(self, detector: Arc<dyn AntiBotDetector>) -> Self
pub fn detect_anti_bot(self, detector: Arc<dyn AntiBotDetector>) -> Self
Enables response inspection with a caller-supplied anti-bot detector.
Sourcepub fn detect_anti_bot_default(self) -> Self
pub fn detect_anti_bot_default(self) -> Self
Opts into the default anti-bot detector.
Detection is off by default so SmartKind promotion and default crawls are unaffected.
Sourcepub fn header_generator(self, enabled: bool) -> Self
pub fn header_generator(self, enabled: bool) -> Self
Enables or disables deterministic browser-like request headers.
Sourcepub fn snapshot_errors_on_failure(self, enabled: bool) -> Self
pub fn snapshot_errors_on_failure(self, enabled: bool) -> Self
Enables or disables response-body snapshots when handlers fail.
Registers an HTTP hook that runs immediately before navigation.
Registers an HTTP hook that runs after navigation.
Sourcepub fn build(self) -> Result<HttpKind, HttpClientError>
pub fn build(self) -> Result<HttpKind, HttpClientError>
Builds the kind, constructing a typed-error ReqwestClient when none was injected.