pub struct ProxyItem {
pub proxy: ProxyEnum,
pub error_count: u32,
pub success_count: u32,
pub last_used: Option<Duration>,
pub expire_time: Duration,
pub provider_name: String,
pub response_time: Option<Duration>,
pub success_rate: f32,
pub rate_limit_tracker: RateLimitTracker,
pub provider_rate_limit: f32,
}Fields§
§proxy: ProxyEnum§error_count: u32§success_count: u32§last_used: Option<Duration>§expire_time: Duration§provider_name: String§response_time: Option<Duration>§success_rate: f32§rate_limit_tracker: RateLimitTracker§provider_rate_limit: f32Implementations§
Source§impl ProxyItem
impl ProxyItem
pub fn new_for_tunnel(tunnel: Tunnel) -> Self
pub fn new_for_ip_proxy(ip_proxy: IpProxy, ip_provider: &IpProvider) -> Self
pub fn new_for_static_ip_proxy( ip_proxy: IpProxy, provider_name: String, rate_limit: f32, ) -> Self
pub fn is_expired(&self) -> bool
pub fn is_valid(&self, max_errors: u32) -> bool
pub fn record_success(&mut self, response_time: Duration)
pub fn record_error(&mut self)
pub fn quality_score(&self) -> f32
pub fn is_rate_limited(&mut self) -> bool
Trait Implementations§
impl Eq for ProxyItem
Source§impl Ord for ProxyItem
impl Ord for ProxyItem
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Auto Trait Implementations§
impl Freeze for ProxyItem
impl RefUnwindSafe for ProxyItem
impl Send for ProxyItem
impl Sync for ProxyItem
impl Unpin for ProxyItem
impl UnsafeUnpin for ProxyItem
impl UnwindSafe for ProxyItem
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