Struct humphrey_server::server::proxy::LoadBalancer
source · pub struct LoadBalancer {
pub targets: Vec<String>,
pub mode: LoadBalancerMode,
pub index: usize,
pub lcg: Lcg,
}
Expand description
Represents a load balancer.
Fields§
§targets: Vec<String>
The targets of the load balancer.
mode: LoadBalancerMode
The algorithm used to choose a target.
index: usize
The current target.
lcg: Lcg
The random number generator used by the load balancer.
Implementations§
source§impl LoadBalancer
impl LoadBalancer
sourcepub fn select_target(&mut self) -> String
pub fn select_target(&mut self) -> String
Selects a target according to the load balancer mode.
Trait Implementations§
source§impl Clone for LoadBalancer
impl Clone for LoadBalancer
source§fn clone(&self) -> LoadBalancer
fn clone(&self) -> LoadBalancer
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LoadBalancer
impl Debug for LoadBalancer
source§impl PartialEq for LoadBalancer
impl PartialEq for LoadBalancer
source§fn eq(&self, other: &LoadBalancer) -> bool
fn eq(&self, other: &LoadBalancer) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for LoadBalancer
impl StructuralEq for LoadBalancer
impl StructuralPartialEq for LoadBalancer
Auto Trait Implementations§
impl RefUnwindSafe for LoadBalancer
impl Send for LoadBalancer
impl Sync for LoadBalancer
impl Unpin for LoadBalancer
impl UnwindSafe for LoadBalancer
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