pub struct ProxyPoolConfigBuilder { /* private fields */ }Expand description
Builder for ProxyPoolConfig.
Implementations§
Source§impl ProxyPoolConfigBuilder
impl ProxyPoolConfigBuilder
Sourcepub fn sources(self, sources: Vec<impl Into<String>>) -> Self
pub fn sources(self, sources: Vec<impl Into<String>>) -> Self
Set the source URLs to fetch proxy lists from.
Sourcepub fn health_check_interval(self, interval: Duration) -> Self
pub fn health_check_interval(self, interval: Duration) -> Self
Set the interval between health checks.
Sourcepub fn health_check_timeout(self, timeout: Duration) -> Self
pub fn health_check_timeout(self, timeout: Duration) -> Self
Set the timeout for health checks.
Sourcepub fn min_available_proxies(self, count: usize) -> Self
pub fn min_available_proxies(self, count: usize) -> Self
Set the minimum number of available proxies.
Sourcepub fn health_check_url(self, url: impl Into<String>) -> Self
pub fn health_check_url(self, url: impl Into<String>) -> Self
Set the URL used for health checks.
Sourcepub fn retry_count(self, count: usize) -> Self
pub fn retry_count(self, count: usize) -> Self
Set the number of times to retry a request with different proxies.
Sourcepub fn selection_strategy(self, strategy: ProxySelectionStrategy) -> Self
pub fn selection_strategy(self, strategy: ProxySelectionStrategy) -> Self
Set the strategy for selecting proxies.
Sourcepub fn max_requests_per_second(self, rps: f64) -> Self
pub fn max_requests_per_second(self, rps: f64) -> Self
Set the maximum requests per second per proxy.
Sourcepub fn build(self) -> ProxyPoolConfig
pub fn build(self) -> ProxyPoolConfig
Build the configuration.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProxyPoolConfigBuilder
impl RefUnwindSafe for ProxyPoolConfigBuilder
impl Send for ProxyPoolConfigBuilder
impl Sync for ProxyPoolConfigBuilder
impl Unpin for ProxyPoolConfigBuilder
impl UnwindSafe for ProxyPoolConfigBuilder
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
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