pub struct ProxyPool {
pub config: ProxyPoolConfig,
/* private fields */
}Expand description
A pool of proxies that can be used for HTTP requests.
Fields§
§config: ProxyPoolConfigConfiguration for the pool.
Implementations§
Source§impl ProxyPool
impl ProxyPool
Sourcepub async fn new(config: ProxyPoolConfig) -> Result<Arc<Self>, Error>
pub async fn new(config: ProxyPoolConfig) -> Result<Arc<Self>, Error>
Create a new proxy pool with the given configuration. This will fetch proxies from sources and perform health checks synchronously.
Sourcepub async fn check_all_proxies(&self)
pub async fn check_all_proxies(&self)
Check the health of all proxies in the pool.
Sourcepub fn get_proxy(&self) -> Result<Proxy, NoProxyAvailable>
pub fn get_proxy(&self) -> Result<Proxy, NoProxyAvailable>
Get a proxy from the pool according to the configured selection strategy.
Sourcepub fn report_proxy_success(&self, url: &str)
pub fn report_proxy_success(&self, url: &str)
Report a successful request through a proxy.
Sourcepub fn report_proxy_failure(&self, url: &str)
pub fn report_proxy_failure(&self, url: &str)
Report a failed request through a proxy.
Auto Trait Implementations§
impl !Freeze for ProxyPool
impl !RefUnwindSafe for ProxyPool
impl Send for ProxyPool
impl Sync for ProxyPool
impl Unpin for ProxyPool
impl UnsafeUnpin for ProxyPool
impl !UnwindSafe for ProxyPool
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