#[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
sourceimpl Clone for NodeSelectionStrategy
impl Clone for NodeSelectionStrategy
sourcefn clone(&self) -> NodeSelectionStrategy
fn clone(&self) -> NodeSelectionStrategy
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for NodeSelectionStrategy
impl Debug for NodeSelectionStrategy
sourceimpl PartialEq<NodeSelectionStrategy> for NodeSelectionStrategy
impl PartialEq<NodeSelectionStrategy> for NodeSelectionStrategy
sourcefn eq(&self, other: &NodeSelectionStrategy) -> bool
fn eq(&self, other: &NodeSelectionStrategy) -> bool
impl Copy for NodeSelectionStrategy
impl Eq for NodeSelectionStrategy
impl StructuralEq for NodeSelectionStrategy
impl StructuralPartialEq for NodeSelectionStrategy
Auto Trait Implementations
impl RefUnwindSafe for NodeSelectionStrategy
impl Send for NodeSelectionStrategy
impl Sync for NodeSelectionStrategy
impl Unpin for NodeSelectionStrategy
impl UnwindSafe for NodeSelectionStrategy
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.