pub struct ProxyRotator { /* private fields */ }Expand description
Proxy rotator for distributing requests across multiple proxies
Implementations§
Source§impl ProxyRotator
impl ProxyRotator
Sourcepub fn new(proxies: Vec<String>, mode: RotationMode) -> Self
pub fn new(proxies: Vec<String>, mode: RotationMode) -> Self
Create a new proxy rotator from a list of URLs
Sourcepub fn from_file(path: &Path, mode: RotationMode) -> Result<Self>
pub fn from_file(path: &Path, mode: RotationMode) -> Result<Self>
Create from a proxy file (one URL per line)
HIGH-002 fix: Validates and canonicalizes the path before reading to:
- Resolve symlinks to their actual target
- Normalize path traversal sequences (../)
- Provide a clear error if the file doesn’t exist
Sourcepub fn mark_failed(&self)
pub fn mark_failed(&self)
Mark current proxy as failed and move to next
Auto Trait Implementations§
impl !Freeze for ProxyRotator
impl RefUnwindSafe for ProxyRotator
impl Send for ProxyRotator
impl Sync for ProxyRotator
impl Unpin for ProxyRotator
impl UnwindSafe for ProxyRotator
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