pub enum Strategy {
RoundRobin,
WeightedRoundRobin,
LeastConnections,
WeightedLeastConnections,
Random,
WeightedRandom,
ConsistentHash,
LeastLatency,
LeastLoad,
PowerOfTwo,
Adaptive,
}Expand description
Load balancing strategy
Variants§
RoundRobin
Round-robin selection
WeightedRoundRobin
Weighted round-robin based on node capacity
LeastConnections
Select node with fewest active connections
WeightedLeastConnections
Weighted least connections
Random
Random selection
WeightedRandom
Weighted random selection
ConsistentHash
Consistent hashing for sticky sessions
LeastLatency
Select based on lowest latency
LeastLoad
Select based on lowest resource utilization
PowerOfTwo
Power of two random choices
Adaptive
Adaptive strategy based on conditions
Trait Implementations§
impl Copy for Strategy
Source§impl<'de> Deserialize<'de> for Strategy
impl<'de> Deserialize<'de> for Strategy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Strategy
impl StructuralPartialEq for Strategy
Auto Trait Implementations§
impl Freeze for Strategy
impl RefUnwindSafe for Strategy
impl Send for Strategy
impl Sync for Strategy
impl Unpin for Strategy
impl UnsafeUnpin for Strategy
impl UnwindSafe for Strategy
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> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.