pub struct ProxyPool { /* private fields */ }Expand description
Shared proxy pool state used by middleware.
Implementations§
Source§impl ProxyPool
impl ProxyPool
Sourcepub fn new(proxies: Vec<Proxy>) -> Result<Self>
pub fn new(proxies: Vec<Proxy>) -> Result<Self>
Create a proxy pool with the default strategy (ProxyPoolStrategy::StickyFailover).
Sourcepub fn with_strategy(
proxies: Vec<Proxy>,
strategy: ProxyPoolStrategy,
) -> Result<Self>
pub fn with_strategy( proxies: Vec<Proxy>, strategy: ProxyPoolStrategy, ) -> Result<Self>
Create a proxy pool with the specified strategy.
Sourcepub fn builder() -> ProxyPoolBuilder
pub fn builder() -> ProxyPoolBuilder
Create a builder for constructing a proxy pool.
Sourcepub fn strategy(&self) -> ProxyPoolStrategy
pub fn strategy(&self) -> ProxyPoolStrategy
Return the proxy selection strategy.
Sourcepub fn is_failure_status(status: StatusCode) -> bool
pub fn is_failure_status(status: StatusCode) -> bool
Returns true if the HTTP status should be treated as a proxy-failure signal.
Trait Implementations§
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
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