pub struct HttpClientConfig {
pub timeout: Duration,
pub max_redirects: usize,
pub retry_policy: RetryPolicy,
pub user_agent: Arc<UserAgentRotator>,
pub max_body_size: usize,
pub pool_max_idle_per_host: usize,
pub pool_max_idle: usize,
pub tcp_keepalive: Option<Duration>,
}Expand description
Configuration for the HTTP client.
Controls timeout, redirect policy, retry behavior, connection pooling,
and HTTP/2 settings. Can be constructed from a CrawlConfig.
§Examples
use crawlkit_engine::{CrawlConfig, http::HttpClientConfig};
let config = HttpClientConfig::from(&CrawlConfig::default());
assert_eq!(config.max_body_size, 10 * 1024 * 1024);Fields§
§timeout: DurationRequest timeout.
max_redirects: usizeMaximum number of redirects to follow.
retry_policy: RetryPolicyRetry policy.
user_agent: Arc<UserAgentRotator>User-agent rotator.
max_body_size: usizeMaximum response body size in bytes (0 = unlimited).
pool_max_idle_per_host: usizeMaximum number of idle connections per host.
pool_max_idle: usizeMaximum number of idle connections across all hosts.
tcp_keepalive: Option<Duration>Whether to enable TCP keepalive.
Trait Implementations§
Source§impl Clone for HttpClientConfig
impl Clone for HttpClientConfig
Source§fn clone(&self) -> HttpClientConfig
fn clone(&self) -> HttpClientConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpClientConfig
impl Debug for HttpClientConfig
Source§impl From<&CrawlConfig> for HttpClientConfig
impl From<&CrawlConfig> for HttpClientConfig
Source§fn from(config: &CrawlConfig) -> Self
fn from(config: &CrawlConfig) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for HttpClientConfig
impl RefUnwindSafe for HttpClientConfig
impl Send for HttpClientConfig
impl Sync for HttpClientConfig
impl Unpin for HttpClientConfig
impl UnsafeUnpin for HttpClientConfig
impl UnwindSafe for HttpClientConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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