pub struct IPClient { /* private fields */ }Expand description
Load balancer for reqwest::Client instances bound to specific IP addresses.
Uses interval-based allocation.
Implementations§
Source§impl IPClient
impl IPClient
Sourcepub fn new(entries: Vec<(Duration, Client)>) -> Self
pub fn new(entries: Vec<(Duration, Client)>) -> Self
Create a new interval-based load balancer with given clients.
Sourcepub fn with_ip(ip: Vec<IpAddr>, interval: Duration) -> Self
pub fn with_ip(ip: Vec<IpAddr>, interval: Duration) -> Self
Build a load balancer using all local IP addresses.
Sourcepub fn with_timeout(
ip: Vec<IpAddr>,
interval: Duration,
timeout: Duration,
) -> Self
pub fn with_timeout( ip: Vec<IpAddr>, interval: Duration, timeout: Duration, ) -> Self
Build a load balancer using IP addresses with a per-client timeout.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IPClient
impl RefUnwindSafe for IPClient
impl Send for IPClient
impl Sync for IPClient
impl Unpin for IPClient
impl UnwindSafe for IPClient
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