#[repr(i32)]pub enum LoadBalancingAlgorithms {
RoundRobin = 0,
Random = 1,
LeastLoaded = 2,
PowerOfTwo = 3,
Hrw = 4,
Maglev = 5,
}Variants§
RoundRobin = 0
Random = 1
LeastLoaded = 2
PowerOfTwo = 3
Hrw = 4
Highest-Random-Weight / rendezvous hashing — client-affine backend
selection. Maps a client key (on UDP the source IP, or source IP and
port per UdpAffinityKey; the source IP, or the
cluster’s affinity_header / affinity_cookie, on HTTP, HTTPS and
TCP) to a backend that survives minimal disruption on backend
add/remove.
Maglev = 5
Maglev consistent hashing — precomputed lookup table for even, stable backend distribution across the same client keyspace as HRW.
Implementations§
Source§impl LoadBalancingAlgorithms
impl LoadBalancingAlgorithms
Sourcepub const fn is_valid(value: i32) -> bool
pub const fn is_valid(value: i32) -> bool
Returns true if value is a variant of LoadBalancingAlgorithms.
Sourcepub fn from_i32(value: i32) -> Option<LoadBalancingAlgorithms>
👎Deprecated: Use the TryFrom<i32> implementation instead
pub fn from_i32(value: i32) -> Option<LoadBalancingAlgorithms>
Use the TryFrom<i32> implementation instead
Converts an i32 to a LoadBalancingAlgorithms, or None if value is not a valid variant.
Source§impl LoadBalancingAlgorithms
impl LoadBalancingAlgorithms
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
Source§impl Clone for LoadBalancingAlgorithms
impl Clone for LoadBalancingAlgorithms
impl Copy for LoadBalancingAlgorithms
Source§impl Debug for LoadBalancingAlgorithms
impl Debug for LoadBalancingAlgorithms
Source§impl Default for LoadBalancingAlgorithms
impl Default for LoadBalancingAlgorithms
Source§fn default() -> LoadBalancingAlgorithms
fn default() -> LoadBalancingAlgorithms
Source§impl<'de> Deserialize<'de> for LoadBalancingAlgorithms
impl<'de> Deserialize<'de> for LoadBalancingAlgorithms
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>,
impl Eq for LoadBalancingAlgorithms
Source§impl From<LoadBalancingAlgorithms> for i32
impl From<LoadBalancingAlgorithms> for i32
Source§fn from(value: LoadBalancingAlgorithms) -> i32
fn from(value: LoadBalancingAlgorithms) -> i32
Source§impl FromStr for LoadBalancingAlgorithms
impl FromStr for LoadBalancingAlgorithms
Source§impl Hash for LoadBalancingAlgorithms
impl Hash for LoadBalancingAlgorithms
Source§impl Ord for LoadBalancingAlgorithms
impl Ord for LoadBalancingAlgorithms
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for LoadBalancingAlgorithms
impl PartialEq for LoadBalancingAlgorithms
Source§impl PartialOrd for LoadBalancingAlgorithms
impl PartialOrd for LoadBalancingAlgorithms
Source§impl Serialize for LoadBalancingAlgorithms
impl Serialize for LoadBalancingAlgorithms
impl StructuralPartialEq for LoadBalancingAlgorithms
Source§impl TryFrom<i32> for LoadBalancingAlgorithms
impl TryFrom<i32> for LoadBalancingAlgorithms
Source§type Error = UnknownEnumValue
type Error = UnknownEnumValue
Source§fn try_from(value: i32) -> Result<LoadBalancingAlgorithms, UnknownEnumValue>
fn try_from(value: i32) -> Result<LoadBalancingAlgorithms, UnknownEnumValue>
Auto Trait Implementations§
impl Freeze for LoadBalancingAlgorithms
impl RefUnwindSafe for LoadBalancingAlgorithms
impl Send for LoadBalancingAlgorithms
impl Sync for LoadBalancingAlgorithms
impl Unpin for LoadBalancingAlgorithms
impl UnsafeUnpin for LoadBalancingAlgorithms
impl UnwindSafe for LoadBalancingAlgorithms
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
key and return true if they are equal.