pub struct SelectionState { /* private fields */ }Expand description
State for stateful selection strategies.
Implementations§
Source§impl SelectionState
impl SelectionState
Sourcepub fn select(
&self,
strategy: &SelectionStrategy,
allowed: &[bool],
) -> Option<usize>
pub fn select( &self, strategy: &SelectionStrategy, allowed: &[bool], ) -> Option<usize>
Select the next provider index.
allowed is a slice of booleans indicating which providers are available
(circuit breaker allows requests).
Sourcepub fn record_latency(&self, index: usize, latency: Duration)
pub fn record_latency(&self, index: usize, latency: Duration)
Record observed latency for a provider (used by LatencyBased strategy).
Auto Trait Implementations§
impl !Freeze for SelectionState
impl RefUnwindSafe for SelectionState
impl Send for SelectionState
impl Sync for SelectionState
impl Unpin for SelectionState
impl UnsafeUnpin for SelectionState
impl UnwindSafe for SelectionState
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