#[non_exhaustive]pub enum NodeSelectionStrategy {
PinUntilError,
PinUntilErrorWithoutReshuffle,
Balanced,
}
Expand description
Specifies the strategy used to select a node of a service to use for a request attempt.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
PinUntilError
Pin to a single host as long as it continues to successfully respond to requests.
If the pinned node fails to successfully respond, the client will rotate through the other nodes until it finds one that can successfully respond and then pin to that new node. The pinned node will also be randomly rotated periodically to help spread load across the cluster.
This is the default behavior.
PinUntilErrorWithoutReshuffle
Like PinUntilError
except that the pinned node is never randomly shuffled.
Balanced
For each new request, select the “next” node (in some unspecified order).
Trait Implementations§
source§impl Clone for NodeSelectionStrategy
impl Clone for NodeSelectionStrategy
source§fn clone(&self) -> NodeSelectionStrategy
fn clone(&self) -> NodeSelectionStrategy
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 NodeSelectionStrategy
impl Debug for NodeSelectionStrategy
source§impl Hash for NodeSelectionStrategy
impl Hash for NodeSelectionStrategy
source§impl PartialEq for NodeSelectionStrategy
impl PartialEq for NodeSelectionStrategy
source§fn eq(&self, other: &NodeSelectionStrategy) -> bool
fn eq(&self, other: &NodeSelectionStrategy) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for NodeSelectionStrategy
impl Eq for NodeSelectionStrategy
impl StructuralPartialEq for NodeSelectionStrategy
Auto Trait Implementations§
impl Freeze for NodeSelectionStrategy
impl RefUnwindSafe for NodeSelectionStrategy
impl Send for NodeSelectionStrategy
impl Sync for NodeSelectionStrategy
impl Unpin for NodeSelectionStrategy
impl UnwindSafe for NodeSelectionStrategy
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<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.